Skip to content

Commit 32b083a

Browse files
Andy Kinggregkh
authored andcommitted
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: Dan Carpenter <[email protected]> Signed-off-by: Andy King <[email protected]> Signed-off-by: Dmitry Torokhov <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 42281d2 commit 32b083a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/misc/vmw_vmci/vmci_queue_pair.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3355,11 +3355,11 @@ ssize_t vmci_qpair_dequev(struct vmci_qp *qpair,
33553355
{
33563356
ssize_t result;
33573357

3358-
qp_lock(qpair);
3359-
33603358
if (!qpair || !iov)
33613359
return VMCI_ERROR_INVALID_ARGS;
33623360

3361+
qp_lock(qpair);
3362+
33633363
do {
33643364
result = qp_dequeue_locked(qpair->produce_q,
33653365
qpair->consume_q,

0 commit comments

Comments
 (0)