Commit 0976b888 authored by Jakub Kicinski's avatar Jakub Kicinski Committed by David S. Miller

ethtool: fix null-ptr-deref on ref tracker

dev can be a NULL here, not all requests set require_dev.

Fixes: e4b89540 ("netlink: add net device refcount tracker to struct ethnl_req_info")
Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
Reviewed-by: default avatarEric Dumazet <edumazet@google.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent a9aa5e33
......@@ -141,8 +141,10 @@ int ethnl_parse_header_dev_get(struct ethnl_req_info *req_info,
return -EINVAL;
}
req_info->dev = dev;
netdev_tracker_alloc(dev, &req_info->dev_tracker, GFP_KERNEL);
if (dev) {
req_info->dev = dev;
netdev_tracker_alloc(dev, &req_info->dev_tracker, GFP_KERNEL);
}
req_info->flags = flags;
return 0;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment