qcacmn: Avoid NULL pointer dereference of pointer 'pPacket'

Pointer 'pPacket' returned from call to the function
'htc_packet_dequeue' may be NULL.

Add a NULL check for pPacket before dereferencing it.

Change-Id: I1ecb82cce0fc00877b3ec2de2676027dde261186
CRs-Fixed: 2478206
This commit is contained in:
Alok Kumar
2019-06-24 16:31:59 +05:30
committed by nshrivas
parent f1d4eaaa3a
commit 5d4c6f2f17

View File

@@ -1068,8 +1068,10 @@ static enum HTC_SEND_QUEUE_RESULT htc_try_send(HTC_TARGET *target,
/* pop off caller's queue */ /* pop off caller's queue */
pPacket = htc_packet_dequeue(pCallersSendQueue); pPacket = htc_packet_dequeue(pCallersSendQueue);
A_ASSERT(pPacket); A_ASSERT(pPacket);
/* insert into local queue */ if (pPacket)
HTC_PACKET_ENQUEUE(&sendQueue, pPacket); /* insert into local queue */
HTC_PACKET_ENQUEUE(&sendQueue,
pPacket);
} }
/* the caller's queue has all the packets that won't fit /* the caller's queue has all the packets that won't fit