mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-07 19:30:30 +09:00
netpoll: Fix device name check in netpoll_setup()
commit 0c3a8f8b8f 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>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
146558f0d2
commit
64696ba957
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user