forked from Minki/linux
net: add net device refcount tracker to dev_ifsioc()
Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
5ae2195088
commit
14ed029b5e
@ -313,6 +313,7 @@ static int dev_ifsioc(struct net *net, struct ifreq *ifr, void __user *data,
|
||||
int err;
|
||||
struct net_device *dev = __dev_get_by_name(net, ifr->ifr_name);
|
||||
const struct net_device_ops *ops;
|
||||
netdevice_tracker dev_tracker;
|
||||
|
||||
if (!dev)
|
||||
return -ENODEV;
|
||||
@ -381,10 +382,10 @@ static int dev_ifsioc(struct net *net, struct ifreq *ifr, void __user *data,
|
||||
return -ENODEV;
|
||||
if (!netif_is_bridge_master(dev))
|
||||
return -EOPNOTSUPP;
|
||||
dev_hold(dev);
|
||||
dev_hold_track(dev, &dev_tracker, GFP_KERNEL);
|
||||
rtnl_unlock();
|
||||
err = br_ioctl_call(net, netdev_priv(dev), cmd, ifr, NULL);
|
||||
dev_put(dev);
|
||||
dev_put_track(dev, &dev_tracker);
|
||||
rtnl_lock();
|
||||
return err;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user