Skip to contentSkip to conversation

pppoe: missing result check in __pppoe_xmit()

PATCH In review [email protected] 1 participant 1 message Jun 2, 2006

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 15/17 pppoe: missing result check in __pppoe_xmit()

From: Florin Malita <[email protected]>

skb_clone() may fail, we should check the result.

Coverity CID: 1215.

---

 drivers/net/pppoe.c |    3 +++
 1 file changed, 3 insertions(+)
drivers/net/pppoe.c renamed from drivers/net/pppoe.c~pppoe-missing-result-check-in-__pppoe_xmit +3 -0
diff -puN drivers/net/pppoe.c~pppoe-missing-result-check-in-__pppoe_xmit drivers/net/pppoe.c
@@ -861,6 +861,9 @@ static int __pppoe_xmit(struct sock *sk,
 		 * give dev_queue_xmit something it can free.
 		 */
 		skb2 = skb_clone(skb, GFP_ATOMIC);
+
+		if (skb2 == NULL)
+			goto abort;
 	}
 
 	ph = (struct pppoe_hdr *) skb_push(skb2, sizeof(struct pppoe_hdr));

_