Commit 09579ac8 authored by Hans Wippel's avatar Hans Wippel Committed by David S. Miller

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: default avatarHans Wippel <hwippel@linux.vnet.ibm.com>
Signed-off-by: default avatarUrsula Braun <ubraun@linux.vnet.ibm.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent f0ef1f4f
...@@ -380,6 +380,7 @@ static int smc_ib_fill_gid_and_mac(struct smc_ib_device *smcibdev, u8 ibport) ...@@ -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); ndev = smcibdev->ibdev->get_netdev(smcibdev->ibdev, ibport);
if (ndev) { if (ndev) {
memcpy(&smcibdev->mac, ndev->dev_addr, ETH_ALEN); memcpy(&smcibdev->mac, ndev->dev_addr, ETH_ALEN);
dev_put(ndev);
} else if (!rc) { } else if (!rc) {
memcpy(&smcibdev->mac[ibport - 1][0], memcpy(&smcibdev->mac[ibport - 1][0],
&smcibdev->gid[ibport - 1].raw[8], 3); &smcibdev->gid[ibport - 1].raw[8], 3);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment