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

Commit 81c24024 authored by Rohith Kollalsi's avatar Rohith Kollalsi Committed by Gerrit - the friendly Code Review server
Browse files

usb: u_ether: Add null pointer check for sk_buff in eth_start_xmit



There is a possibility of null pointer dereference for sk_buff in
the function eth_start_xmit. Fix this by removing sk_buff from if
check at the start of the function eth_start_xmit so that if sk_buff
is null dev_kfree_skb_any will return without proceeding further.

Change-Id: I105e42c59aaa83c8d74cc5a9e894ae4fc87c3c9f
Signed-off-by: default avatarRohith Kollalsi <rkollals@codeaurora.org>
parent 9e73b22a
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -495,7 +495,7 @@ static netdev_tx_t eth_start_xmit(struct sk_buff *skb,
	}
	spin_unlock_irqrestore(&dev->lock, flags);

	if (skb && !in) {
	if (!in) {
		dev_kfree_skb_any(skb);
		return NETDEV_TX_OK;
	}