Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3328ed96 authored by Alok Kumar's avatar Alok Kumar Committed by nshrivas
Browse files

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
parent 478f6936
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -1037,8 +1037,10 @@ static enum HTC_SEND_QUEUE_RESULT htc_try_send(HTC_TARGET *target,
				/* pop off caller's queue */
				pPacket = htc_packet_dequeue(pCallersSendQueue);
				A_ASSERT(pPacket != NULL);
				if (pPacket)
					/* insert into local queue */
				HTC_PACKET_ENQUEUE(&sendQueue, pPacket);
					HTC_PACKET_ENQUEUE(&sendQueue,
							   pPacket);
			}

			/* the caller's queue has all the packets that won't fit