Skip to content

Commit

Permalink
VMCI: Fix deref before NULL-check of queuepair ptr
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
Andy King authored and gregkh committed Jan 17, 2013
1 parent 42281d2 commit 32b083a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/misc/vmw_vmci/vmci_queue_pair.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 32b083a

Please sign in to comment.