Skip to content

Commit 9950acf

Browse files
rleondledford
authored andcommitted
RDMA/cxgb4: Protect from possible dereference
Smatch tool reports the following error: drivers/infiniband/hw/cxgb4/qp.c:1886 c4iw_create_qp() error: we previously assumed 'ucontext' could be null (see line 1804) Cc: Steve Wise <[email protected]> Signed-off-by: Leon Romanovsky <[email protected]> Reviewed-by: Steve Wise <[email protected]> Signed-off-by: Doug Ledford <[email protected]>
1 parent e32d2d7 commit 9950acf

File tree

1 file changed

+1
-1
lines changed
  • drivers/infiniband/hw/cxgb4

1 file changed

+1
-1
lines changed

drivers/infiniband/hw/cxgb4/qp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1843,7 +1843,7 @@ struct ib_qp *c4iw_create_qp(struct ib_pd *pd, struct ib_qp_init_attr *attrs,
18431843
if (ret)
18441844
goto err_destroy_qp;
18451845

1846-
if (udata) {
1846+
if (udata && ucontext) {
18471847
sq_key_mm = kmalloc(sizeof(*sq_key_mm), GFP_KERNEL);
18481848
if (!sq_key_mm) {
18491849
ret = -ENOMEM;

0 commit comments

Comments
 (0)