ipv4: fix a memory leak in ic_bootp_send_if
Subsystems (3)
PATCH 1/1 ipv4: fix a memory leak in ic_bootp_send_if
From: RongQing.Li <[email protected]>
when dev_hard_header() failed, the newly allocated skb should be freed.
Signed-off-by RongQing.Li <[email protected]>
--- net/ipv4/ipconfig.c | 9 +++++++-- 1 files changed, 7 insertions(+), 2 deletions(-)
net/ipv4/ipconfig.c +7 -2
@@ -822,8 +822,13 @@ static void __init ic_bootp_send_if(struct ic_device *d, unsigned long jiffies_d skb->dev = dev; skb->protocol =htons (ETH_P_IP );if (dev_hard_header (skb, dev,ntohs (skb->protocol), - dev->broadcast, dev->dev_addr, skb->len) <0 || -dev_queue_xmit (skb) <0 ) + dev->broadcast, dev->dev_addr, skb->len) <0 ) { +kfree_skb (skb); +printk ("E" ); +return ; + } + +if (dev_queue_xmit (skb) <0 )printk ("E" ); }
Signature · 1 line
1.7.1
From: [email protected]
Date: Mon, 14 Nov 2011 15:54:08 +0800
Quoted 5 lines
From: RongQing.Li <[email protected]>
when
dev_hard_header()failed, the newly allocated skb should be freed.Signed-off-by RongQing.Li <[email protected]>
Applied.