提交 0c3a8f8b 编写于 作者: M Matthias Kaehlcke 提交者: David S. Miller

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: NMatthias Kaehlcke <mka@chromium.org>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 d94708a5
......@@ -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);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册