summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Kaehlcke <mka@chromium.org>2017-07-25 11:36:25 -0700
committerAlexander Grund <flamefire89@gmail.com>2024-01-06 12:35:55 +0100
commit9af33e9d545d7ed0b02c3a935eb41816902bc1e7 (patch)
tree93903e26f23fb4ac4f1f7cfe07faf424ff082ebe
parentc39aaece91aacc6d9f64dbfb3b0e83cd37db9476 (diff)
UPSTREAM: netpoll: Fix device name check in netpoll_setup()
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> (cherry picked from commit 0c3a8f8b8fabff4f3ad2dd7b95ae0e90cdd1aebb) Bug: 78886293 Change-Id: I1a6eec091c4bab5769a3519196f529030a71b6dd Signed-off-by: Alistair Strachan <astrachan@google.com>
-rw-r--r--net/core/netpoll.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/core/netpoll.c b/net/core/netpoll.c
index 2a64de757be9..8d612cefb5f3 100644
--- a/net/core/netpoll.c
+++ b/net/core/netpoll.c
@@ -668,7 +668,7 @@ int netpoll_setup(struct netpoll *np)
int err;
rtnl_lock();
- if (np->dev_name)
+ if (np->dev_name[0])
ndev = __dev_get_by_name(net, np->dev_name);
if (!ndev) {