Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 43e2ada3 authored by Ursula Braun's avatar Ursula Braun Committed by David S. Miller
Browse files

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: default avatarUrsula Braun <ubraun@linux.vnet.ibm.com>
Reported-by: default avatarParav Pandit <parav@mellanox.com>
Reviewed-by: default avatarParav Pandit <parav@mellanox.com>
Fixes: 0cfdd8f9 ("smc: connection and link group creation")
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent d921c420
Loading
Loading
Loading
Loading
+8 −4
Original line number Diff line number Diff line
@@ -380,11 +380,15 @@ static int smc_link_determine_gid(struct smc_link_group *lgr)
		if (ib_query_gid(lnk->smcibdev->ibdev, lnk->ibport, i, &gid,
				 &gattr))
			continue;
		if (gattr.ndev &&
		    (vlan_dev_vlan_id(gattr.ndev) == lgr->vlan_id)) {
		if (gattr.ndev) {
			if (is_vlan_dev(gattr.ndev) &&
			    vlan_dev_vlan_id(gattr.ndev) == lgr->vlan_id) {
				lnk->gid = gid;
				dev_put(gattr.ndev);
				return 0;
			}
			dev_put(gattr.ndev);
		}
	}
	return -ENODEV;
}