提交 ad79eefc 编写于 作者: R RongQing.Li 提交者: 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: NRongQing.Li <roy.qing.li@gmail.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册