From 89fd2576cba4bacd1a1a8738313a913d4ca95855 Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Fri, 25 Aug 2017 11:18:39 +0300 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 Signed-off-by: Doug Ledford --- drivers/infiniband/hw/qedr/verbs.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/infiniband/hw/qedr/verbs.c b/drivers/infiniband/hw/qedr/verbs.c index 1c995c6da8d8..249b560a32d7 100644 --- a/drivers/infiniband/hw/qedr/verbs.c +++ b/drivers/infiniband/hw/qedr/verbs.c @@ -818,8 +818,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;