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>
This commit is contained in:
parent
4fca5a0c00
commit
ac7f6028a7
1 changed files with 1 additions and 1 deletions
|
@ -666,7 +666,7 @@ int netpoll_setup(struct netpoll *np)
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
rtnl_lock();
|
rtnl_lock();
|
||||||
if (np->dev_name) {
|
if (np->dev_name[0]) {
|
||||||
struct net *net = current->nsproxy->net_ns;
|
struct net *net = current->nsproxy->net_ns;
|
||||||
ndev = __dev_get_by_name(net, np->dev_name);
|
ndev = __dev_get_by_name(net, np->dev_name);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue