RDMA/siw: Fix failure handling during device creation
authorBernard Metzler <bmt@zurich.ibm.com>
Mon, 2 Mar 2020 15:58:14 +0000 (16:58 +0100)
committerJason Gunthorpe <jgg@mellanox.com>
Wed, 4 Mar 2020 18:26:23 +0000 (14:26 -0400)
commit12e5eef0f4d8087ea7b559f6630be08ffea2d851
treebc1d87f903a53c9ecb7234d66f38bb5f7f5940d6
parent78f34a16c28654cb47791257006f90d0948f2f0c
RDMA/siw: Fix failure handling during device creation

A failing call to ib_device_set_netdev() during device creation caused
system crash due to xa_destroy of uninitialized xarray hit by device
deallocation. Fixed by moving xarray initialization before potential
device deallocation.

Fixes: bdcf26bf9b3a ("rdma/siw: network and RDMA core interface")
Link: https://lore.kernel.org/r/20200302155814.9896-1-bmt@zurich.ibm.com
Reported-by: syzbot+2e80962bedd9559fe0b3@syzkaller.appspotmail.com
Signed-off-by: Bernard Metzler <bmt@zurich.ibm.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
drivers/infiniband/sw/siw/siw_main.c