aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/misc
diff options
context:
space:
mode:
authorAndy King <acking@vmware.com>2013-01-10 18:41:40 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-01-17 15:07:39 -0500
commit32b083a3fd1452b9d5aba8e781ca95b566f3e054 (patch)
tree352be2ecd9e5d5aa3689a3b41336692b274711fd /drivers/misc
parent42281d20cdf94a9d2aae67ee019f8bcc390ebed6 (diff)
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 <dan.carpenter@oracle.com> Signed-off-by: Andy King <acking@vmware.com> Signed-off-by: Dmitry Torokhov <dtor@vmware.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/misc')
-rw-r--r--drivers/misc/vmw_vmci/vmci_queue_pair.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/misc/vmw_vmci/vmci_queue_pair.c b/drivers/misc/vmw_vmci/vmci_queue_pair.c
index da47e457e158..6417a26df8d8 100644
--- a/drivers/misc/vmw_vmci/vmci_queue_pair.c
+++ b/drivers/misc/vmw_vmci/vmci_queue_pair.c
@@ -3355,11 +3355,11 @@ ssize_t vmci_qpair_dequev(struct vmci_qp *qpair,
3355{ 3355{
3356 ssize_t result; 3356 ssize_t result;
3357 3357
3358 qp_lock(qpair);
3359
3360 if (!qpair || !iov) 3358 if (!qpair || !iov)
3361 return VMCI_ERROR_INVALID_ARGS; 3359 return VMCI_ERROR_INVALID_ARGS;
3362 3360
3361 qp_lock(qpair);
3362
3363 do { 3363 do {
3364 result = qp_dequeue_locked(qpair->produce_q, 3364 result = qp_dequeue_locked(qpair->produce_q,
3365 qpair->consume_q, 3365 qpair->consume_q,