提交 09579ac8 编写于 作者: H Hans Wippel 提交者: 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: NHans Wippel <hwippel@linux.vnet.ibm.com>
Signed-off-by: NUrsula Braun <ubraun@linux.vnet.ibm.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册