All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] IB/hns: checking for IS_ERR() instead of NULL
@ 2017-08-04  8:12 ` Dan Carpenter
  0 siblings, 0 replies; 4+ messages in thread
From: Dan Carpenter @ 2017-08-04  8:12 UTC (permalink / raw)
  To: Lijun Ou, Shaobo Xu
  Cc: Wei Hu(Xavier),
	Doug Ledford, Sean Hefty, Hal Rosenstock,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA,
	kernel-janitors-u79uwXL29TY76Z2rM5mHXA

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-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>

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;
 		}
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH] IB/hns: checking for IS_ERR() instead of NULL
@ 2017-08-04  8:12 ` Dan Carpenter
  0 siblings, 0 replies; 4+ messages in thread
From: Dan Carpenter @ 2017-08-04  8:12 UTC (permalink / raw)
  To: Lijun Ou, Shaobo Xu
  Cc: Wei Hu(Xavier),
	Doug Ledford, Sean Hefty, Hal Rosenstock,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA,
	kernel-janitors-u79uwXL29TY76Z2rM5mHXA

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;
 		}

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] IB/hns: checking for IS_ERR() instead of NULL
  2017-08-04  8:12 ` Dan Carpenter
@ 2017-08-04 19:11   ` Doug Ledford
  -1 siblings, 0 replies; 4+ messages in thread
From: Doug Ledford @ 2017-08-04 19:11 UTC (permalink / raw)
  To: Dan Carpenter, Lijun Ou, Shaobo Xu
  Cc: Wei Hu(Xavier),
	Sean Hefty, Hal Rosenstock, linux-rdma-u79uwXL29TY76Z2rM5mHXA,
	kernel-janitors-u79uwXL29TY76Z2rM5mHXA

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-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
> 
> 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.

-- 
Doug Ledford <dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
    GPG KeyID: B826A3330E572FDD
    Key fingerprint = AE6B 1BDA 122B 23B4 265B  1274 B826 A333 0E57 2FDD

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] IB/hns: checking for IS_ERR() instead of NULL
@ 2017-08-04 19:11   ` Doug Ledford
  0 siblings, 0 replies; 4+ messages in thread
From: Doug Ledford @ 2017-08-04 19:11 UTC (permalink / raw)
  To: Dan Carpenter, Lijun Ou, Shaobo Xu
  Cc: Wei Hu(Xavier),
	Sean Hefty, Hal Rosenstock, linux-rdma-u79uwXL29TY76Z2rM5mHXA,
	kernel-janitors-u79uwXL29TY76Z2rM5mHXA

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.

-- 
Doug Ledford <dledford@redhat.com>
    GPG KeyID: B826A3330E572FDD
    Key fingerprint = AE6B 1BDA 122B 23B4 265B  1274 B826 A333 0E57 2FDD


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-08-04 19:11 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-04  8:12 [PATCH] IB/hns: checking for IS_ERR() instead of NULL Dan Carpenter
2017-08-04  8:12 ` Dan Carpenter
2017-08-04 19:11 ` Doug Ledford
2017-08-04 19:11   ` Doug Ledford

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.