RE: [PATCH] RDMA/qedr: Missing error code in qedr_init_user_queue()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Dan Carpenter [mailto:dan.carpenter@xxxxxxxxxx]
Sent: Friday, August 25, 2017 11:19 AM
> To: Amrani, Ram <Ram.Amrani@xxxxxxxxxx>; Kalderon@mwanda;
> Kalderon, Michal <Michal.Kalderon@xxxxxxxxxx>
> Cc: Elior, Ariel <Ariel.Elior@xxxxxxxxxx>; Doug Ledford
> <dledford@xxxxxxxxxx>; Sean Hefty <sean.hefty@xxxxxxxxx>; Hal
> Rosenstock <hal.rosenstock@xxxxxxxxx>; linux-rdma@xxxxxxxxxxxxxxx;
> kernel-janitors@xxxxxxxxxxxxxxx
> Subject: [PATCH] RDMA/qedr: Missing error code in qedr_init_user_queue()
> 
> We should return -ENOMEM if the kzalloc() fails.  We currently return
> success.
> 
> Fixes: 69ad0e7fe845 ("RDMA/qedr: Add support for iWARP in user space")
> Signed-off-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
> 
> diff --git a/drivers/infiniband/hw/qedr/verbs.c
> b/drivers/infiniband/hw/qedr/verbs.c
> index 4e14a558734b..bce4f79370e6 100644
> --- a/drivers/infiniband/hw/qedr/verbs.c
> +++ b/drivers/infiniband/hw/qedr/verbs.c
> @@ -821,8 +821,10 @@ static inline int qedr_init_user_queue(struct
> ib_ucontext *ib_ctx,
>  				   FW_PAGE_SHIFT);
>  	} else {
>  		q->pbl_tbl = kzalloc(sizeof(*q->pbl_tbl), GFP_KERNEL);
> -		if (!q->pbl_tbl)
> +		if (!q->pbl_tbl) {
> +			rc = -ENOMEM;
>  			goto err0;
> +		}
>  	}
> 
>  	return 0;

Thanks, Dan

Acked-by: Michal Kalderon <Michal.Kalderon@xxxxxxxxxx>
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux