mirror of
https://github.com/FEX-Emu/linux.git
synced 2024-12-29 04:45:05 +00:00
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>
This commit is contained in:
parent
42281d20cd
commit
32b083a3fd
@ -3355,11 +3355,11 @@ ssize_t vmci_qpair_dequev(struct vmci_qp *qpair,
|
|||||||
{
|
{
|
||||||
ssize_t result;
|
ssize_t result;
|
||||||
|
|
||||||
qp_lock(qpair);
|
|
||||||
|
|
||||||
if (!qpair || !iov)
|
if (!qpair || !iov)
|
||||||
return VMCI_ERROR_INVALID_ARGS;
|
return VMCI_ERROR_INVALID_ARGS;
|
||||||
|
|
||||||
|
qp_lock(qpair);
|
||||||
|
|
||||||
do {
|
do {
|
||||||
result = qp_dequeue_locked(qpair->produce_q,
|
result = qp_dequeue_locked(qpair->produce_q,
|
||||||
qpair->consume_q,
|
qpair->consume_q,
|
||||||
|
Loading…
Reference in New Issue
Block a user