Skip to content

Commit

Permalink
net/smc: adjust net_device refcount
Browse files Browse the repository at this point in the history
smc_pnet_fill_entry() uses dev_get_by_name() adding a refcount to ndev.
The following smc_pnet_enter() has to reduce the refcount if the entry
to be added exists already in the pnet table.

Signed-off-by: Ursula Braun <ubraun@linux.vnet.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Ursula Braun authored and davem330 committed Sep 21, 2017
1 parent 731b008 commit a6832c3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion net/smc/smc_pnet.c
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,10 @@ static int smc_pnet_enter(struct smc_pnetentry *new_pnetelem)
sizeof(new_pnetelem->ndev->name)) ||
smc_pnet_same_ibname(pnetelem,
new_pnetelem->smcibdev->ibdev->name,
new_pnetelem->ib_port))
new_pnetelem->ib_port)) {
dev_put(pnetelem->ndev);
goto found;
}
}
list_add_tail(&new_pnetelem->list, &smc_pnettable.pnetlist);
rc = 0;
Expand Down

0 comments on commit a6832c3

Please sign in to comment.