Skip to content

Commit 94fdd7c

Browse files
edumazetdavem330
authored andcommitted
net/smc: use GFP_ATOMIC allocation in smc_pnet_add_eth()
My last patch moved the netdev_tracker_alloc() call to a section protected by a write_lock(). I should have replaced GFP_KERNEL with GFP_ATOMIC to avoid the infamous: BUG: sleeping function called from invalid context at include/linux/sched/mm.h:256 Fixes: 28f9222 ("net/smc: fix ref_tracker issue in smc_pnet_add()") Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 28f9222 commit 94fdd7c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/smc/smc_pnet.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@ static int smc_pnet_add_eth(struct smc_pnettable *pnettable, struct net *net,
382382
if (ndev) {
383383
new_pe->ndev = ndev;
384384
netdev_tracker_alloc(ndev, &new_pe->dev_tracker,
385-
GFP_KERNEL);
385+
GFP_ATOMIC);
386386
}
387387
list_add_tail(&new_pe->list, &pnettable->pnetlist);
388388
write_unlock(&pnettable->lock);

0 commit comments

Comments
 (0)