RE: [PATCH -next] IB/qib: Add missing err handle for qib_user_sdma_rb_insert
From: Marciniszyn, Mike
Date: Fri Jan 04 2019 - 13:39:55 EST
> diff --git a/drivers/infiniband/hw/qib/qib_user_sdma.c
> b/drivers/infiniband/hw/qib/qib_user_sdma.c
> index 31c523b..e87c0a7 100644
> --- a/drivers/infiniband/hw/qib/qib_user_sdma.c
> +++ b/drivers/infiniband/hw/qib/qib_user_sdma.c
> @@ -237,6 +237,8 @@ qib_user_sdma_queue_create(struct device *dev,
> int unit, int ctxt, int sctxt)
>
> ret = qib_user_sdma_rb_insert(&qib_user_sdma_rb_root,
> sdma_rb_node);
> + if (ret == 0)
> + goto err_rb;
> }
> pq->sdma_rb_node = sdma_rb_node;
>
> --
> 2.7.0
>
Thanks!
This patch is ok.
The NULL returned from this routine will result in an error return up to PSM which will fail.
The bail branch will do the necessary cleanup, including freeing the node that couldn't be added.
Acked-by: Mike Marciniszyn <mike.marciniszyn@xxxxxxxxx>