diff mbox

RDMA/bnxt_re: checking for NULL instead of IS_ERR()

Message ID 20170710072247.6eczlwcxu5mt5jry@mwanda (mailing list archive)
State Accepted
Headers show

Commit Message

Dan Carpenter July 10, 2017, 7:22 a.m. UTC
bnxt_re_alloc_mw() doesn't return NULL, it returns error pointers.

Fixes: 9152e0b722b2 ("RDMA/bnxt_re: HW workarounds for handling specific conditions")
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

Selvin Xavier July 10, 2017, 9:34 a.m. UTC | #1
Acked-by: Selvin Xavier <selvin.xavier@broadcom.com>

Thanks

On Mon, Jul 10, 2017 at 12:52 PM, Dan Carpenter
<dan.carpenter@oracle.com> wrote:
> bnxt_re_alloc_mw() doesn't return NULL, it returns error pointers.
>
> Fixes: 9152e0b722b2 ("RDMA/bnxt_re: HW workarounds for handling specific conditions")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
>
> diff --git a/drivers/infiniband/hw/bnxt_re/ib_verbs.c b/drivers/infiniband/hw/bnxt_re/ib_verbs.c
> index c7bd68311d0c..e794b0fa4ae6 100644
> --- a/drivers/infiniband/hw/bnxt_re/ib_verbs.c
> +++ b/drivers/infiniband/hw/bnxt_re/ib_verbs.c
> @@ -588,10 +588,10 @@ static int bnxt_re_create_fence_mr(struct bnxt_re_pd *pd)
>
>         /* Create a fence MW only for kernel consumers */
>         mw = bnxt_re_alloc_mw(&pd->ib_pd, IB_MW_TYPE_1, NULL);
> -       if (!mw) {
> +       if (IS_ERR(mw)) {
>                 dev_err(rdev_to_dev(rdev),
>                         "Failed to create fence-MW for PD: %p\n", pd);
> -               rc = -EINVAL;
> +               rc = PTR_ERR(mw);
>                 goto fail;
>         }
>         fence->mw = mw;
--
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
Doug Ledford July 22, 2017, 5:26 p.m. UTC | #2
On 7/10/2017 3:22 AM, Dan Carpenter wrote:
> bnxt_re_alloc_mw() doesn't return NULL, it returns error pointers.
> 
> Fixes: 9152e0b722b2 ("RDMA/bnxt_re: HW workarounds for handling specific conditions")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

This was accepted into 4.13-rc, thanks.
diff mbox

Patch

diff --git a/drivers/infiniband/hw/bnxt_re/ib_verbs.c b/drivers/infiniband/hw/bnxt_re/ib_verbs.c
index c7bd68311d0c..e794b0fa4ae6 100644
--- a/drivers/infiniband/hw/bnxt_re/ib_verbs.c
+++ b/drivers/infiniband/hw/bnxt_re/ib_verbs.c
@@ -588,10 +588,10 @@  static int bnxt_re_create_fence_mr(struct bnxt_re_pd *pd)
 
 	/* Create a fence MW only for kernel consumers */
 	mw = bnxt_re_alloc_mw(&pd->ib_pd, IB_MW_TYPE_1, NULL);
-	if (!mw) {
+	if (IS_ERR(mw)) {
 		dev_err(rdev_to_dev(rdev),
 			"Failed to create fence-MW for PD: %p\n", pd);
-		rc = -EINVAL;
+		rc = PTR_ERR(mw);
 		goto fail;
 	}
 	fence->mw = mw;