linux/drivers/infiniband
Wei Hu(Xavier) 5e437b1d7e RDMA/hns: Avoid NULL pointer exception
After the loop in hns_roce_v1_mr_free_work_fn function, it is possible that
all qps will have been freed (in which case ne will be 0).  If that
happens, then later in the function when we dereference hr_qp we will
get an exception.  Check ne is not 0 to make sure we actually have an
hr_qp left to work on.

This patch fixes the smatch error as below:
drivers/infiniband/hw/hns/hns_roce_hw_v1.c:1009 hns_roce_v1_mr_free_work_fn()
error: we previously assumed 'hr_qp' could be null

Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
Signed-off-by: Lijun Ou <oulijun@huawei.com>
Signed-off-by: Shaobo Xu <xushaobo2@huawei.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
2017-09-29 12:10:09 -04:00
..
core IB/uverbs: clean up INIT_UDATA() macro usage 2017-09-27 08:54:19 -04:00
hw RDMA/hns: Avoid NULL pointer exception 2017-09-29 12:10:09 -04:00
sw IB: Move PCI dependency from root KConfig to HW's KConfigs 2017-09-27 08:54:19 -04:00
ulp IB/{ipoib, iser}: Consistent print format of vendor error 2017-09-29 11:18:56 -04:00
Kconfig IB: Move PCI dependency from root KConfig to HW's KConfigs 2017-09-27 08:54:19 -04:00
Makefile IB/rdmavt: Create module framework and handle driver registration 2016-03-10 20:37:04 -05:00