Skip to content

Commit 41a0be3

Browse files
karstengrkuba-moo
authored andcommitted
net/smc: fix direct access to ib_gid_addr->ndev in smc_ib_determine_gid()
Sparse complaints 3 times about: net/smc/smc_ib.c:203:52: warning: incorrect type in argument 1 (different address spaces) net/smc/smc_ib.c:203:52: expected struct net_device const *dev net/smc/smc_ib.c:203:52: got struct net_device [noderef] __rcu *const ndev Fix that by using the existing and validated ndev variable instead of accessing attr->ndev directly. Fixes: 5102eca ("net/smc: Use rdma_read_gid_l2_fields to L2 fields") Signed-off-by: Karsten Graul <[email protected]> Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 0530bd6 commit 41a0be3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Diff for: net/smc/smc_ib.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -198,9 +198,9 @@ int smc_ib_determine_gid(struct smc_ib_device *smcibdev, u8 ibport,
198198
rcu_read_lock();
199199
ndev = rdma_read_gid_attr_ndev_rcu(attr);
200200
if (!IS_ERR(ndev) &&
201-
((!vlan_id && !is_vlan_dev(attr->ndev)) ||
202-
(vlan_id && is_vlan_dev(attr->ndev) &&
203-
vlan_dev_vlan_id(attr->ndev) == vlan_id)) &&
201+
((!vlan_id && !is_vlan_dev(ndev)) ||
202+
(vlan_id && is_vlan_dev(ndev) &&
203+
vlan_dev_vlan_id(ndev) == vlan_id)) &&
204204
attr->gid_type == IB_GID_TYPE_ROCE) {
205205
rcu_read_unlock();
206206
if (gid)

0 commit comments

Comments
 (0)