Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

+3 -3
+3 -3
net/core/net-sysfs.c
··· 1328 1328 struct netdev_rx_queue *queue = &dev->_rx[i]; 1329 1329 struct kobject *kobj = &queue->kobj; 1330 1330 1331 - if (!refcount_read(&dev_net(dev)->ns.count)) 1331 + if (!check_net(dev_net(dev))) 1332 1332 kobj->uevent_suppress = 1; 1333 1333 if (dev->sysfs_rx_queue_group) 1334 1334 sysfs_remove_group(kobj, dev->sysfs_rx_queue_group); ··· 2061 2061 while (--i >= new_num) { 2062 2062 struct netdev_queue *queue = dev->_tx + i; 2063 2063 2064 - if (!refcount_read(&dev_net(dev)->ns.count)) 2064 + if (!check_net(dev_net(dev))) 2065 2065 queue->kobj.uevent_suppress = 1; 2066 2066 2067 2067 if (netdev_uses_bql(dev)) ··· 2315 2315 { 2316 2316 struct device *dev = &ndev->dev; 2317 2317 2318 - if (!refcount_read(&dev_net(ndev)->ns.count)) 2318 + if (!check_net(dev_net(ndev))) 2319 2319 dev_set_uevent_suppress(dev, 1); 2320 2320 2321 2321 kobject_get(&dev->kobj);