Message ID | Pine.LNX.4.64.0909111821360.10552@pc-004.diku.dk |
---|---|
State | Accepted, archived |
Delegated to: | David Miller |
Headers | show |
From: Julia Lawall <julia@diku.dk> Date: Fri, 11 Sep 2009 18:21:51 +0200 (CEST) > Error handling code following a kmalloc should free the allocated data. > > The semantic match that finds the problem is as follows: > (http://www.emn.fr/x-info/coccinelle/) ... > Signed-off-by: Julia Lawall <julia@diku.dk> Applied. -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/drivers/net/wan/hdlc_ppp.c b/drivers/net/wan/hdlc_ppp.c index 72a7cda..b9b9d6b 100644 --- a/drivers/net/wan/hdlc_ppp.c +++ b/drivers/net/wan/hdlc_ppp.c @@ -389,6 +389,7 @@ static void ppp_cp_parse_cr(struct net_device *dev, u16 pid, u8 id, for (opt = data; len; len -= opt[1], opt += opt[1]) { if (len < 2 || len < opt[1]) { dev->stats.rx_errors++; + kfree(out); return; /* bad packet, drop silently */ }