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

Commit 525c36c0 authored by Alok Chauhan's avatar Alok Chauhan
Browse files

msm: emac: Fix invalid pointer dereference



Add defensive check to avoid null pointer
dereference during filling up transmit
descriptor.

Change-Id: Iee1bbcb46c3179ca16e7a4016d7969b2ad37ff01
Signed-off-by: default avatarAlok Chauhan <alokc@codeaurora.org>
parent e99d73e0
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -796,6 +796,8 @@ static void emac_poll_hwtxtstamp(struct emac_adapter *adpt)
				 */
				while ((pskb = __skb_dequeue(pending_q))
				       != skb) {
					if (!pskb)
						break;
					EMAC_HWTXTSTAMP_CB(pskb)->sec = 0;
					EMAC_HWTXTSTAMP_CB(pskb)->ns = 0;
					__skb_queue_tail(q, pskb);
@@ -1256,6 +1258,7 @@ static void emac_tx_map(struct emac_adapter *adpt,
	/* The last buffer info contain the skb address,
	 * so it will be freed after unmap
	 */
	if (tpbuf)
		tpbuf->skb = skb;
}