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

Commit 32b083a3 authored by Andy King's avatar Andy King Committed by Greg Kroah-Hartman
Browse files

VMCI: Fix deref before NULL-check of queuepair ptr



Check for a valid queuepair ptr before trying to lock the queuepair (which will
deref it).

Reported-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarAndy King <acking@vmware.com>
Signed-off-by: default avatarDmitry Torokhov <dtor@vmware.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 42281d20
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -3355,11 +3355,11 @@ ssize_t vmci_qpair_dequev(struct vmci_qp *qpair,
{
	ssize_t result;

	qp_lock(qpair);

	if (!qpair || !iov)
		return VMCI_ERROR_INVALID_ARGS;

	qp_lock(qpair);

	do {
		result = qp_dequeue_locked(qpair->produce_q,
					   qpair->consume_q,