Skip to content

Commit

Permalink
[PATCH] iseries_veth: Don't leak skbs in RX path
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Michael Ellerman authored and Jeff Garzik committed May 15, 2005
1 parent eb235ae commit 41664c0
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions drivers/net/iseries_veth.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 41664c0

Please sign in to comment.