Skip to content

Commit

Permalink
Spidernet another skb mem leak
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Linas Vepstas authored and Jeff Garzik committed Feb 5, 2007
1 parent 05b346b commit 366684b
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions drivers/net/spider_net.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 366684b

Please sign in to comment.