Netdev List
 help / color / mirror / Atom feed
* [PATCH 3/4] iseries_veth: Don't leak skbs in RX path
@ 2005-05-12  7:55 Michael Ellerman
  0 siblings, 0 replies; only message in thread
From: Michael Ellerman @ 2005-05-12  7:55 UTC (permalink / raw)
  To: Andrew Morton, Jeff Garzik; +Cc: netdev, linux-kernel

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>
--

 iseries_veth.c |   17 +++++++++++------
 1 files changed, 11 insertions(+), 6 deletions(-)

Index: veth-fixes/drivers/net/iseries_veth.c
===================================================================
--- veth-fixes.orig/drivers/net/iseries_veth.c
+++ veth-fixes/drivers/net/iseries_veth.c
@@ -1264,13 +1264,18 @@ static void veth_receive(struct veth_lpa
 
 		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;

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2005-05-12  7:55 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-05-12  7:55 [PATCH 3/4] iseries_veth: Don't leak skbs in RX path Michael Ellerman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox