Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9285faa1 authored by Tom Tucker's avatar Tom Tucker Committed by Roland Dreier
Browse files

RDMA/amso1100: Add check for NULL reply_msg in c2_intr()



Fix a place where we might dereference a NULL pointer; this fixes
Coverity CID 1392.  On inspection I also found a place where we could
attempt to kmem_cache_free() a NULL pointer, so fix this too.

Signed-off-by: default avatarTom Tucker <tom@opengridcomputing.com>
Signed-off-by: default avatarRoland Dreier <rolandd@cisco.com>
parent bbf8eed1
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -422,7 +422,7 @@ void c2_free_cq(struct c2_dev *c2dev, struct c2_cq *cq)
		goto bail1;

	reply = (struct c2wr_cq_destroy_rep *) (unsigned long) (vq_req->reply_msg);

	if (reply)
		vq_repbuf_free(c2dev, reply);
      bail1:
	vq_req_free(c2dev, vq_req);
+5 −1
Original line number Diff line number Diff line
@@ -174,7 +174,11 @@ static void handle_vq(struct c2_dev *c2dev, u32 mq_index)
		return;
	}

	if (reply_msg)
		err = c2_errno(reply_msg);
	else
		err = -ENOMEM;

	if (!err) switch (req->event) {
	case IW_CM_EVENT_ESTABLISHED:
		c2_set_qp_state(req->qp,