Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent eead059 commit 00af2aaCopy full SHA for 00af2aa
net/smc/smc_pnet.c
@@ -806,6 +806,16 @@ static void smc_pnet_create_pnetids_list(struct net *net)
806
u8 ndev_pnetid[SMC_MAX_PNETID_LEN];
807
struct net_device *dev;
808
809
+ /* Newly created netns do not have devices.
810
+ * Do not even acquire rtnl.
811
+ */
812
+ if (list_empty(&net->dev_base_head))
813
+ return;
814
+
815
+ /* Note: This might not be needed, because smc_pnet_netdev_event()
816
+ * is also calling smc_pnet_add_base_pnetid() when handling
817
+ * NETDEV_UP event.
818
819
rtnl_lock();
820
for_each_netdev(net, dev)
821
smc_pnet_add_base_pnetid(net, dev, ndev_pnetid);
0 commit comments