Message ID | 20220206050516.23178-1-eric.dumazet@gmail.com (mailing list archive) |
---|---|
State | Accepted |
Commit | 28f9222138868899c53e00bc1f910faa55f88546 |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | [net] net/smc: fix ref_tracker issue in smc_pnet_add() | expand |
Hello: This patch was applied to netdev/net.git (master) by David S. Miller <davem@davemloft.net>: On Sat, 5 Feb 2022 21:05:16 -0800 you wrote: > From: Eric Dumazet <edumazet@google.com> > > I added the netdev_tracker_alloc() right after ndev was > stored into the newly allocated object: > > new_pe->ndev = ndev; > if (ndev) > netdev_tracker_alloc(ndev, &new_pe->dev_tracker, GFP_KERNEL); > > [...] Here is the summary with links: - [net] net/smc: fix ref_tracker issue in smc_pnet_add() https://git.kernel.org/netdev/net/c/28f922213886 You are awesome, thank you!
On Sat, Feb 5, 2022 at 9:05 PM Eric Dumazet <eric.dumazet@gmail.com> wrote: > > > diff --git a/net/smc/smc_pnet.c b/net/smc/smc_pnet.c > index 291f1484a1b74c0a793ab3c4f3ef90804d1f9932..fb6331d97185a5db9b4539e7f081e9fa469bc44b 100644 > --- a/net/smc/smc_pnet.c > +++ b/net/smc/smc_pnet.c > @@ -368,9 +368,6 @@ static int smc_pnet_add_eth(struct smc_pnettable *pnettable, struct net *net, > new_pe->type = SMC_PNET_ETH; > memcpy(new_pe->pnet_name, pnet_name, SMC_MAX_PNETID_LEN); > strncpy(new_pe->eth_name, eth_name, IFNAMSIZ); > - new_pe->ndev = ndev; > - if (ndev) > - netdev_tracker_alloc(ndev, &new_pe->dev_tracker, GFP_KERNEL); > rc = -EEXIST; > new_netdev = true; > write_lock(&pnettable->lock); > @@ -382,6 +379,11 @@ static int smc_pnet_add_eth(struct smc_pnettable *pnettable, struct net *net, > } > } > if (new_netdev) { > + if (ndev) { > + new_pe->ndev = ndev; > + netdev_tracker_alloc(ndev, &new_pe->dev_tracker, > + GFP_KERNEL); Oh well, this needs to become GFP_ATOMIC, we are under a write_lock() section. I will send a fix :/ > + } > list_add_tail(&new_pe->list, &pnettable->pnetlist); > write_unlock(&pnettable->lock); > } else { > -- > 2.35.0.263.gb82422642f-goog >
diff --git a/net/smc/smc_pnet.c b/net/smc/smc_pnet.c index 291f1484a1b74c0a793ab3c4f3ef90804d1f9932..fb6331d97185a5db9b4539e7f081e9fa469bc44b 100644 --- a/net/smc/smc_pnet.c +++ b/net/smc/smc_pnet.c @@ -368,9 +368,6 @@ static int smc_pnet_add_eth(struct smc_pnettable *pnettable, struct net *net, new_pe->type = SMC_PNET_ETH; memcpy(new_pe->pnet_name, pnet_name, SMC_MAX_PNETID_LEN); strncpy(new_pe->eth_name, eth_name, IFNAMSIZ); - new_pe->ndev = ndev; - if (ndev) - netdev_tracker_alloc(ndev, &new_pe->dev_tracker, GFP_KERNEL); rc = -EEXIST; new_netdev = true; write_lock(&pnettable->lock); @@ -382,6 +379,11 @@ static int smc_pnet_add_eth(struct smc_pnettable *pnettable, struct net *net, } } if (new_netdev) { + if (ndev) { + new_pe->ndev = ndev; + netdev_tracker_alloc(ndev, &new_pe->dev_tracker, + GFP_KERNEL); + } list_add_tail(&new_pe->list, &pnettable->pnetlist); write_unlock(&pnettable->lock); } else {