RDMA/qedr: Missing error code in qedr_init_user_queue()

We should return -ENOMEM if the kzalloc() fails.  We currently return
success.

Fixes: 69ad0e7fe8 ("RDMA/qedr: Add support for iWARP in user space")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
This commit is contained in:
Dan Carpenter 2017-08-25 11:18:39 +03:00 committed by Doug Ledford
parent 69ad0e7fe8
commit 89fd2576cb
1 changed files with 3 additions and 1 deletions

View File

@ -818,8 +818,10 @@ static inline int qedr_init_user_queue(struct ib_ucontext *ib_ctx,
FW_PAGE_SHIFT); FW_PAGE_SHIFT);
} else { } else {
q->pbl_tbl = kzalloc(sizeof(*q->pbl_tbl), GFP_KERNEL); q->pbl_tbl = kzalloc(sizeof(*q->pbl_tbl), GFP_KERNEL);
if (!q->pbl_tbl) if (!q->pbl_tbl) {
rc = -ENOMEM;
goto err0; goto err0;
}
} }
return 0; return 0;