netpoll: Fix device name check in netpoll_setup()
authorMatthias Kaehlcke <mka@chromium.org>
Tue, 25 Jul 2017 18:36:25 +0000 (11:36 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 27 Feb 2019 09:07:01 +0000 (10:07 +0100)
commit64696ba9577f7742358cd7be42da2a4eb4877244
tree2cbe271d4e672ea34907ae682189ec8657fe5369
parent146558f0d27f299d607973574e33000f3c8aa87d
netpoll: Fix device name check in netpoll_setup()

commit 0c3a8f8b8fabff4f3ad2dd7b95ae0e90cdd1aebb upstream.

Apparently netpoll_setup() assumes that netpoll.dev_name is a pointer
when checking if the device name is set:

if (np->dev_name) {
  ...

However the field is a character array, therefore the condition always
yields true. Check instead whether the first byte of the array has a
non-zero value.

Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/core/netpoll.c