net/smc: dev_put for netdev after usage of ib_query_gid()
For RoCEs ib_query_gid() takes a reference count on the net_device.
This reference count must be decreased by the caller.
Signed-off-by: Ursula Braun <ubraun@linux.vnet.ibm.com>
Reported-by: Parav Pandit <parav@mellanox.com>
Reviewed-by: Parav Pandit <parav@mellanox.com>
Fixes: 0cfdd8f92c
("smc: connection and link group creation")
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
d921c420d2
commit
43e2ada3e0
|
@ -380,10 +380,14 @@ static int smc_link_determine_gid(struct smc_link_group *lgr)
|
||||||
if (ib_query_gid(lnk->smcibdev->ibdev, lnk->ibport, i, &gid,
|
if (ib_query_gid(lnk->smcibdev->ibdev, lnk->ibport, i, &gid,
|
||||||
&gattr))
|
&gattr))
|
||||||
continue;
|
continue;
|
||||||
if (gattr.ndev &&
|
if (gattr.ndev) {
|
||||||
(vlan_dev_vlan_id(gattr.ndev) == lgr->vlan_id)) {
|
if (is_vlan_dev(gattr.ndev) &&
|
||||||
lnk->gid = gid;
|
vlan_dev_vlan_id(gattr.ndev) == lgr->vlan_id) {
|
||||||
return 0;
|
lnk->gid = gid;
|
||||||
|
dev_put(gattr.ndev);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
dev_put(gattr.ndev);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
|
|
Loading…
Reference in New Issue