mirror of
https://github.com/torvalds/linux.git
synced 2026-03-08 04:04:43 +01:00
net-sysfs: use check_net()
Don't directly acess the namespace count. There's even a dedicated helper for this. Reviewed-by: Jan Kara <jack@suse.cz> Signed-off-by: Christian Brauner <brauner@kernel.org>
This commit is contained in:
parent
96d997ea5a
commit
83914de1c1
1 changed files with 3 additions and 3 deletions
|
|
@ -1328,7 +1328,7 @@ net_rx_queue_update_kobjects(struct net_device *dev, int old_num, int new_num)
|
|||
struct netdev_rx_queue *queue = &dev->_rx[i];
|
||||
struct kobject *kobj = &queue->kobj;
|
||||
|
||||
if (!refcount_read(&dev_net(dev)->ns.count))
|
||||
if (!check_net(dev_net(dev)))
|
||||
kobj->uevent_suppress = 1;
|
||||
if (dev->sysfs_rx_queue_group)
|
||||
sysfs_remove_group(kobj, dev->sysfs_rx_queue_group);
|
||||
|
|
@ -2061,7 +2061,7 @@ netdev_queue_update_kobjects(struct net_device *dev, int old_num, int new_num)
|
|||
while (--i >= new_num) {
|
||||
struct netdev_queue *queue = dev->_tx + i;
|
||||
|
||||
if (!refcount_read(&dev_net(dev)->ns.count))
|
||||
if (!check_net(dev_net(dev)))
|
||||
queue->kobj.uevent_suppress = 1;
|
||||
|
||||
if (netdev_uses_bql(dev))
|
||||
|
|
@ -2315,7 +2315,7 @@ void netdev_unregister_kobject(struct net_device *ndev)
|
|||
{
|
||||
struct device *dev = &ndev->dev;
|
||||
|
||||
if (!refcount_read(&dev_net(ndev)->ns.count))
|
||||
if (!check_net(dev_net(ndev)))
|
||||
dev_set_uevent_suppress(dev, 1);
|
||||
|
||||
kobject_get(&dev->kobj);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue