diff mbox

IB/hns: checking for IS_ERR() instead of NULL

Message ID 20170804081208.qkkj3yons7ljccjp@mwanda (mailing list archive)
State Accepted
Headers show

Commit Message

Dan Carpenter Aug. 4, 2017, 8:12 a.m. UTC
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>

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Doug Ledford Aug. 4, 2017, 7:11 p.m. UTC | #1
On Fri, 2017-08-04 at 11:12 +0300, Dan Carpenter wrote:
> 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>
> 
> diff --git a/drivers/infiniband/hw/hns/hns_roce_hw_v1.c
> b/drivers/infiniband/hw/hns/hns_roce_hw_v1.c
> index 38f5c77baabf..747efd1ae5a6 100644
> --- a/drivers/infiniband/hw/hns/hns_roce_hw_v1.c
> +++ b/drivers/infiniband/hw/hns/hns_roce_hw_v1.c
> @@ -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;
>  		}

Thanks, applied.
diff mbox

Patch

diff --git a/drivers/infiniband/hw/hns/hns_roce_hw_v1.c b/drivers/infiniband/hw/hns/hns_roce_hw_v1.c
index 38f5c77baabf..747efd1ae5a6 100644
--- a/drivers/infiniband/hw/hns/hns_roce_hw_v1.c
+++ b/drivers/infiniband/hw/hns/hns_roce_hw_v1.c
@@ -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;
 		}