summaryrefslogtreecommitdiffstats
path: root/drivers/net/iseries_veth.c
diff options
context:
space:
mode:
authorMichael Ellerman <michael@ellerman.id.au>2005-05-12 09:55:08 +0200
committerJeff Garzik <jgarzik@pobox.com>2005-05-16 00:08:05 +0200
commit41664c03f6c96a1f8a91714309b36f1b5ca85610 (patch)
tree42805cf7bf92cf639f4c2e4dba8d1163cb11844b /drivers/net/iseries_veth.c
parent[PATCH] iseries_veth: Set dev->trans_start so watchdog timer works right (diff)
downloadlinux-41664c03f6c96a1f8a91714309b36f1b5ca85610.tar.xz
linux-41664c03f6c96a1f8a91714309b36f1b5ca85610.zip
[PATCH] iseries_veth: Don't leak skbs in RX path
Hi Andrew, Jeff, Under some strange circumstances the iseries_veth driver can leak skbs. Fix is simply to call dev_kfree_skb() in the right place. Fix up the comment as well. Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Diffstat (limited to 'drivers/net/iseries_veth.c')
-rw-r--r--drivers/net/iseries_veth.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/drivers/net/iseries_veth.c b/drivers/net/iseries_veth.c
index 1e869df656c1..1edecb10993d 100644
--- a/drivers/net/iseries_veth.c
+++ b/drivers/net/iseries_veth.c
@@ -1264,13 +1264,18 @@ static void veth_receive(struct veth_lpar_connection *cnx,
vlan = skb->data[9];
dev = veth_dev[vlan];
- if (! dev)
- /* Some earlier versions of the driver sent
- broadcasts down all connections, even to
- lpars that weren't on the relevant vlan.
- So ignore packets belonging to a vlan we're
- not on. */
+ if (! dev) {
+ /*
+ * Some earlier versions of the driver sent
+ * broadcasts down all connections, even to lpars
+ * that weren't on the relevant vlan. So ignore
+ * packets belonging to a vlan we're not on.
+ * We can also be here if we receive packets while
+ * the driver is going down, because then dev is NULL.
+ */
+ dev_kfree_skb_irq(skb);
continue;
+ }
port = (struct veth_port *)dev->priv;
dest = *((u64 *) skb->data) & 0xFFFFFFFFFFFF0000;