2006-10-18 19:38:48

by Stephen Hemminger

[permalink] [raw]
Subject: [PATCH] netpoll: retry memory leak

If netpoll uses up it's retries, it should drop the skb
not leak memory.

Signed-off-by: Stephen Hemminger <[email protected]>
---
net/core/netpoll.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/net/core/netpoll.c b/net/core/netpoll.c
index ead5920..c375fde 100644
--- a/net/core/netpoll.c
+++ b/net/core/netpoll.c
@@ -273,10 +273,8 @@ static void netpoll_send_skb(struct netp
int status;
struct netpoll_info *npinfo;

- if (!np || !np->dev || !netif_running(np->dev)) {
- __kfree_skb(skb);
- return;
- }
+ if (!np || !np->dev || !netif_running(np->dev))
+ goto free_skb;

npinfo = np->dev->npinfo;

@@ -314,6 +312,8 @@ static void netpoll_send_skb(struct netp
netpoll_poll(np);
udelay(50);
} while (npinfo->tries > 0);
+free_skb:
+ __kfree_skb(skb);
}

void netpoll_send_udp(struct netpoll *np, const char *msg, int len)
--
1.4.2.3