dev can be a NULL here, not all requests set require_dev.
Fixes: e4b8954074f6 ("netlink: add net device refcount tracker to struct ethnl_req_info")
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
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;
}