diff options
author | Matthias Kaehlcke <mka@chromium.org> | 2017-07-25 11:36:25 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-02-27 10:07:01 +0100 |
commit | 64696ba9577f7742358cd7be42da2a4eb4877244 (patch) | |
tree | 2cbe271d4e672ea34907ae682189ec8657fe5369 | |
parent | 146558f0d27f299d607973574e33000f3c8aa87d (diff) |
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>
-rw-r--r-- | net/core/netpoll.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/core/netpoll.c b/net/core/netpoll.c index 457f882b0f7b..9b2d61120c0d 100644 --- a/net/core/netpoll.c +++ b/net/core/netpoll.c @@ -666,7 +666,7 @@ int netpoll_setup(struct netpoll *np) int err; rtnl_lock(); - if (np->dev_name) { + if (np->dev_name[0]) { struct net *net = current->nsproxy->net_ns; ndev = __dev_get_by_name(net, np->dev_name); } |