Skip to content

Commit f70968f

Browse files
Colin Ian Kingjgunthorpe
authored andcommitted
i40iw: fix null pointer dereference on a null wqe pointer
Currently the null check for wqe is incorrect and lets a null wqe be passed to set_64bit_val and this indexes into the null pointer causing a null pointer dereference. Fix this by fixing the null pointer check to return an error if wqe is null. Link: https://lore.kernel.org/r/[email protected] Addresses-Coverity: ("dereference after a null check") Fixes: 4b34e23 ("i40iw: Report correct firmware version") Signed-off-by: Colin Ian King <[email protected]> Acked-by: Shiraz Saleem <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]>
1 parent 8f3d9f3 commit f70968f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/infiniband/hw/i40iw/i40iw_ctrl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1046,7 +1046,7 @@ i40iw_sc_query_rdma_features(struct i40iw_sc_cqp *cqp,
10461046
u64 header;
10471047

10481048
wqe = i40iw_sc_cqp_get_next_send_wqe(cqp, scratch);
1049-
if (wqe)
1049+
if (!wqe)
10501050
return I40IW_ERR_RING_FULL;
10511051

10521052
set_64bit_val(wqe, 32, feat_mem->pa);

0 commit comments

Comments
 (0)