Skip to content

Commit

Permalink
net/smc: add missing dev_put
Browse files Browse the repository at this point in the history
In the infiniband part, SMC currently uses get_netdev which calls
dev_hold on the returned net device. However, the SMC code never calls
dev_put on that net device resulting in a wrong reference count.

This patch adds a dev_put after the usage of the net device to fix the
issue.

Signed-off-by: Hans Wippel <[email protected]>
Signed-off-by: Ursula Braun <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
Hans Wippel authored and davem330 committed Sep 21, 2017
1 parent f0ef1f4 commit 09579ac
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions net/smc/smc_ib.c
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,7 @@ static int smc_ib_fill_gid_and_mac(struct smc_ib_device *smcibdev, u8 ibport)
ndev = smcibdev->ibdev->get_netdev(smcibdev->ibdev, ibport);
if (ndev) {
memcpy(&smcibdev->mac, ndev->dev_addr, ETH_ALEN);
dev_put(ndev);
} else if (!rc) {
memcpy(&smcibdev->mac[ibport - 1][0],
&smcibdev->gid[ibport - 1].raw[8], 3);
Expand Down

0 comments on commit 09579ac

Please sign in to comment.