mirror of
https://github.com/torvalds/linux.git
synced 2026-12-04 12:24:18 +00:00
ethtool: fix null-ptr-deref on ref tracker
dev can be a NULL here, not all requests set require_dev.
Fixes: e4b8954074 ("netlink: add net device refcount tracker to struct ethnl_req_info")
Signed-off-by: Jakub Kicinski <[email protected]>
Reviewed-by: Eric Dumazet <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
This commit is contained in:
committed by
David S. Miller
parent
a9aa5e3320
commit
0976b888a1
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user