diff options
author | Hans Wippel <hwippel@linux.vnet.ibm.com> | 2017-09-21 09:16:26 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-09-22 00:31:02 +0200 |
commit | 09579ac803a3638344b8544b5940793d5358673e (patch) | |
tree | 8b782521ae6440bd1b42d8738a3addaf834c58ac /net | |
parent | net: stmmac: Cocci spatch "of_table" (diff) | |
download | linux-09579ac803a3638344b8544b5940793d5358673e.tar.xz linux-09579ac803a3638344b8544b5940793d5358673e.zip |
net/smc: add missing dev_put
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 <hwippel@linux.vnet.ibm.com>
Signed-off-by: Ursula Braun <ubraun@linux.vnet.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/smc/smc_ib.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/net/smc/smc_ib.c b/net/smc/smc_ib.c index 547e0e113b17..0b5852299158 100644 --- a/net/smc/smc_ib.c +++ b/net/smc/smc_ib.c @@ -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); |