Skip to content

Commit 0434064

Browse files
Kamalheibjgunthorpe
authored andcommitted
RDMA/siw: Fix reporting vendor_part_id
Move the initialization of the vendor_part_id to be before calling ib_register_device(), this is needed because the query_device() callback is called from the context of ib_register_device() before initializing the vendor_part_id, so the reported value is wrong. Fixes: bdcf26b ("rdma/siw: network and RDMA core interface") Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Kamal Heib <[email protected]> Reviewed-by: Bernard Metzler <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]>
1 parent f427f4d commit 0434064

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/infiniband/sw/siw/siw_main.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,13 @@ static int siw_device_register(struct siw_device *sdev, const char *name)
6767
static int dev_id = 1;
6868
int rv;
6969

70+
sdev->vendor_part_id = dev_id++;
71+
7072
rv = ib_register_device(base_dev, name);
7173
if (rv) {
7274
pr_warn("siw: device registration error %d\n", rv);
7375
return rv;
7476
}
75-
sdev->vendor_part_id = dev_id++;
7677

7778
siw_dbg(base_dev, "HWaddr=%pM\n", sdev->netdev->dev_addr);
7879

0 commit comments

Comments
 (0)