IB/hns: checking for IS_ERR() instead of NULL
The hns_roce_v1_create_lp_qp() returns NULL on error, not error pointers. Fixes: bfcc681bd09d ("IB/hns: Fix the bug when free mr") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
This commit is contained in:
committed by
Doug Ledford
parent
931b3c1a83
commit
5db465f235
@ -733,7 +733,7 @@ static int hns_roce_v1_rsv_lp_qp(struct hns_roce_dev *hr_dev)
|
||||
continue;
|
||||
|
||||
free_mr->mr_free_qp[i] = hns_roce_v1_create_lp_qp(hr_dev, pd);
|
||||
if (IS_ERR(free_mr->mr_free_qp[i])) {
|
||||
if (!free_mr->mr_free_qp[i]) {
|
||||
dev_err(dev, "Create loop qp failed!\n");
|
||||
goto create_lp_qp_failed;
|
||||
}
|
||||
|
Reference in New Issue
Block a user