aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/spider_net.c
diff options
context:
space:
mode:
authorLinas Vepstas <linas@austin.ibm.com>2006-12-13 15:16:18 -0600
committerJeff Garzik <jeff@garzik.org>2007-02-05 16:58:44 -0500
commit366684bd0d6bc5b224fc798675b9a85eb9279227 (patch)
treef6e116418d5cddb3e7c707a847b862ebcaa5bf0b /drivers/net/spider_net.c
parent05b346b552e13cc090ea908e2be183b377ff30a2 (diff)
downloadkernel_samsung_smdk4412-366684bd0d6bc5b224fc798675b9a85eb9279227.zip
kernel_samsung_smdk4412-366684bd0d6bc5b224fc798675b9a85eb9279227.tar.gz
kernel_samsung_smdk4412-366684bd0d6bc5b224fc798675b9a85eb9279227.tar.bz2
Spidernet another skb mem leak
Another skb leak in an error branch. Fix this by adding call to dev_kfree_skb_irq() after moving to a more appropriate spot. Signed-off-by: Linas Vepstas <linas@austin.ibm.com> Cc: James K Lewis <jklewis@us.ibm.com> Cc: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/net/spider_net.c')
-rw-r--r--drivers/net/spider_net.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/drivers/net/spider_net.c b/drivers/net/spider_net.c
index f1cd13f..4c26b9a 100644
--- a/drivers/net/spider_net.c
+++ b/drivers/net/spider_net.c
@@ -926,19 +926,8 @@ spider_net_pass_skb_up(struct spider_net_descr *descr,
data_status = descr->data_status;
data_error = descr->data_error;
-
netdev = card->netdev;
- /* the cases we'll throw away the packet immediately */
- if (data_error & SPIDER_NET_DESTROY_RX_FLAGS) {
- if (netif_msg_rx_err(card))
- pr_err("error in received descriptor found, "
- "data_status=x%08x, data_error=x%08x\n",
- data_status, data_error);
- card->spider_stats.rx_desc_error++;
- return 0;
- }
-
skb = descr->skb;
skb->dev = netdev;
skb_put(skb, descr->valid_size);
@@ -1037,6 +1026,18 @@ spider_net_decode_one_descr(struct spider_net_card *card)
goto refill;
}
+ /* The cases we'll throw away the packet immediately */
+ if (descr->data_error & SPIDER_NET_DESTROY_RX_FLAGS) {
+ if (netif_msg_rx_err(card))
+ pr_err("%s: error in received descriptor found, "
+ "data_status=x%08x, data_error=x%08x\n",
+ card->netdev->name,
+ descr->data_status, descr->data_error);
+ card->spider_stats.rx_desc_error++;
+ dev_kfree_skb_irq(descr->skb);
+ goto refill;
+ }
+
/* ok, we've got a packet in descr */
result = spider_net_pass_skb_up(descr, card);
refill: