Commit ad79eefc authored by RongQing.Li's avatar RongQing.Li Committed by David S. Miller

ipv4: fix a memory leak in ic_bootp_send_if

when dev_hard_header() failed, the newly allocated skb should be freed.
Signed-off-by: default avatarRongQing.Li <roy.qing.li@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 5219e4c9
...@@ -822,8 +822,13 @@ static void __init ic_bootp_send_if(struct ic_device *d, unsigned long jiffies_d ...@@ -822,8 +822,13 @@ static void __init ic_bootp_send_if(struct ic_device *d, unsigned long jiffies_d
skb->dev = dev; skb->dev = dev;
skb->protocol = htons(ETH_P_IP); skb->protocol = htons(ETH_P_IP);
if (dev_hard_header(skb, dev, ntohs(skb->protocol), if (dev_hard_header(skb, dev, ntohs(skb->protocol),
dev->broadcast, dev->dev_addr, skb->len) < 0 || dev->broadcast, dev->dev_addr, skb->len) < 0) {
dev_queue_xmit(skb) < 0) kfree_skb(skb);
printk("E");
return;
}
if (dev_queue_xmit(skb) < 0)
printk("E"); printk("E");
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment