]> git.baikalelectronics.ru Git - kernel.git/commit
net/smc: fix direct access to ib_gid_addr->ndev in smc_ib_determine_gid()
authorKarsten Graul <kgraul@linux.ibm.com>
Wed, 18 Nov 2020 21:40:38 +0000 (22:40 +0100)
committerJakub Kicinski <kuba@kernel.org>
Thu, 19 Nov 2020 18:59:19 +0000 (10:59 -0800)
commite1af93c8a89ba162ecc1a01041702bb3ef184c9d
tree0e58091a226c305fefdc2b7b832ccb885f41571f
parentd1247e12d0ea972dff81b445ca99e7f78c76878c
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: ef7ae0505093 ("net/smc: Use rdma_read_gid_l2_fields to L2 fields")
Signed-off-by: Karsten Graul <kgraul@linux.ibm.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/smc/smc_ib.c