netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-2.6 1/3] jme: Fix VLAN memory leak
@ 2010-03-15  5:15 cooldavid
  2010-03-15  5:15 ` [PATCH net-2.6 2/3] jme: Adding lock to protect vlgrp structure cooldavid
  0 siblings, 1 reply; 8+ messages in thread
From: cooldavid @ 2010-03-15  5:15 UTC (permalink / raw)
  To: David Miller; +Cc: Guo-Fu Tseng, linux-netdev, Ethan Hsiao

From: Guo-Fu Tseng <cooldavid@cooldavid.org>

Fix memory leak while receiving 8021q tagged packet which is not
registered by user.

Signed-off-by: Guo-Fu Tseng <cooldavid@cooldavid.org>
---
 drivers/net/jme.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/net/jme.c b/drivers/net/jme.c
index 0f31497..cfc7b98 100644
--- a/drivers/net/jme.c
+++ b/drivers/net/jme.c
@@ -946,6 +946,8 @@ jme_alloc_and_feed_skb(struct jme_adapter *jme, int idx)
 				jme->jme_vlan_rx(skb, jme->vlgrp,
 					le16_to_cpu(rxdesc->descwb.vlan));
 				NET_STAT(jme).rx_bytes += 4;
+			} else {
+				dev_kfree_skb(skb);
 			}
 		} else {
 			jme->jme_rx(skb);
-- 
1.6.4.4


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH net-2.6 2/3] jme: Adding lock to protect vlgrp structure.
  2010-03-15  5:15 [PATCH net-2.6 1/3] jme: Fix VLAN memory leak cooldavid
@ 2010-03-15  5:15 ` cooldavid
  2010-03-15  5:15   ` [PATCH net-2.6 3/3] jme: Advance driver version number cooldavid
  2010-03-15 22:54   ` [PATCH net-2.6 2/3] jme: Adding lock to protect vlgrp structure David Miller
  0 siblings, 2 replies; 8+ messages in thread
From: cooldavid @ 2010-03-15  5:15 UTC (permalink / raw)
  To: David Miller; +Cc: Guo-Fu Tseng, linux-netdev, Ethan Hsiao

From: Guo-Fu Tseng <cooldavid@cooldavid.org>

Adding a lock to prevent modifying the vlgrp structure while receiving
VLAN packet.

Signed-off-by: Guo-Fu Tseng <cooldavid@cooldavid.org>
---
 drivers/net/jme.c |    6 ++++++
 drivers/net/jme.h |    1 +
 2 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/drivers/net/jme.c b/drivers/net/jme.c
index cfc7b98..9096bbd 100644
--- a/drivers/net/jme.c
+++ b/drivers/net/jme.c
@@ -942,11 +942,14 @@ jme_alloc_and_feed_skb(struct jme_adapter *jme, int idx)
 			skb->ip_summed = CHECKSUM_NONE;
 
 		if (rxdesc->descwb.flags & cpu_to_le16(RXWBFLAG_TAGON)) {
+			spin_lock(&jme->vlgrp_lock);
 			if (jme->vlgrp) {
 				jme->jme_vlan_rx(skb, jme->vlgrp,
 					le16_to_cpu(rxdesc->descwb.vlan));
+				spin_unlock(&jme->vlgrp_lock);
 				NET_STAT(jme).rx_bytes += 4;
 			} else {
+				spin_unlock(&jme->vlgrp_lock);
 				dev_kfree_skb(skb);
 			}
 		} else {
@@ -2088,7 +2091,9 @@ jme_vlan_rx_register(struct net_device *netdev, struct vlan_group *grp)
 {
 	struct jme_adapter *jme = netdev_priv(netdev);
 
+	spin_lock_bh(&jme->vlgrp_lock);
 	jme->vlgrp = grp;
+	spin_unlock_bh(&jme->vlgrp_lock);
 }
 
 static void
@@ -2755,6 +2760,7 @@ jme_init_one(struct pci_dev *pdev,
 	spin_lock_init(&jme->phy_lock);
 	spin_lock_init(&jme->macaddr_lock);
 	spin_lock_init(&jme->rxmcs_lock);
+	spin_lock_init(&jme->vlgrp_lock);
 
 	atomic_set(&jme->link_changing, 1);
 	atomic_set(&jme->rx_cleaning, 1);
diff --git a/drivers/net/jme.h b/drivers/net/jme.h
index c19db91..0ed4924 100644
--- a/drivers/net/jme.h
+++ b/drivers/net/jme.h
@@ -393,6 +393,7 @@ struct jme_adapter {
 	spinlock_t		phy_lock;
 	spinlock_t		macaddr_lock;
 	spinlock_t		rxmcs_lock;
+	spinlock_t		vlgrp_lock;
 	struct tasklet_struct	rxempty_task;
 	struct tasklet_struct	rxclean_task;
 	struct tasklet_struct	txclean_task;
-- 
1.6.4.4


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH net-2.6 3/3] jme: Advance driver version number
  2010-03-15  5:15 ` [PATCH net-2.6 2/3] jme: Adding lock to protect vlgrp structure cooldavid
@ 2010-03-15  5:15   ` cooldavid
  2010-03-15 22:54   ` [PATCH net-2.6 2/3] jme: Adding lock to protect vlgrp structure David Miller
  1 sibling, 0 replies; 8+ messages in thread
From: cooldavid @ 2010-03-15  5:15 UTC (permalink / raw)
  To: David Miller; +Cc: Guo-Fu Tseng, linux-netdev, Ethan Hsiao

From: Guo-Fu Tseng <cooldavid@cooldavid.org>

Advance driver version number after some bug fix.

Signed-off-by: Guo-Fu Tseng <cooldavid@cooldavid.org>
---
 drivers/net/jme.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/net/jme.h b/drivers/net/jme.h
index 0ed4924..727a3bf 100644
--- a/drivers/net/jme.h
+++ b/drivers/net/jme.h
@@ -25,7 +25,7 @@
 #define __JME_H_INCLUDED__
 
 #define DRV_NAME	"jme"
-#define DRV_VERSION	"1.0.5"
+#define DRV_VERSION	"1.0.6"
 #define PFX		DRV_NAME ": "
 
 #define PCI_DEVICE_ID_JMICRON_JMC250	0x0250
-- 
1.6.4.4


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH net-2.6 2/3] jme: Adding lock to protect vlgrp structure.
  2010-03-15  5:15 ` [PATCH net-2.6 2/3] jme: Adding lock to protect vlgrp structure cooldavid
  2010-03-15  5:15   ` [PATCH net-2.6 3/3] jme: Advance driver version number cooldavid
@ 2010-03-15 22:54   ` David Miller
  2010-03-16  7:49     ` Guo-Fu Tseng
  1 sibling, 1 reply; 8+ messages in thread
From: David Miller @ 2010-03-15 22:54 UTC (permalink / raw)
  To: cooldavid; +Cc: netdev, ethanhsiao


Please respin this whole patch set when you fix this
vlgrp locking the way I told you to.

Also, please don't submit a seperate series for 2.6.33 it only creates
confusion.  Just add a "CC: stable@kernel.org" right after your
signoff line and it'll get sorted out automatically once the patch
reaches Linus's tree.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH net-2.6 2/3] jme: Adding lock to protect vlgrp structure.
  2010-03-15 22:54   ` [PATCH net-2.6 2/3] jme: Adding lock to protect vlgrp structure David Miller
@ 2010-03-16  7:49     ` Guo-Fu Tseng
  2010-03-16  7:55       ` David Miller
  0 siblings, 1 reply; 8+ messages in thread
From: Guo-Fu Tseng @ 2010-03-16  7:49 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, ethanhsiao

On Mon, 15 Mar 2010 15:54:53 -0700 (PDT), David Miller wrote
> Please respin this whole patch set when you fix this
> vlgrp locking the way I told you to.
> 
> Also, please don't submit a seperate series for 2.6.33 it only creates
> confusion.  Just add a "CC: stable@kernel.org" right after your
> signoff line and it'll get sorted out automatically once the patch
> reaches Linus's tree.
Now I see the "stable_kernel_rules.txt", sorry for the careless.

BTW, is it OK if the patch can only apply on net-2.6 tree cleanly,
but have some Hunks applying to stable kernel? If it is intended
for both net-2.6 and stable kernel.

Guo-Fu Tseng


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH net-2.6 2/3] jme: Adding lock to protect vlgrp structure.
  2010-03-16  7:49     ` Guo-Fu Tseng
@ 2010-03-16  7:55       ` David Miller
  0 siblings, 0 replies; 8+ messages in thread
From: David Miller @ 2010-03-16  7:55 UTC (permalink / raw)
  To: cooldavid; +Cc: netdev, ethanhsiao

From: "Guo-Fu Tseng" <cooldavid@cooldavid.org>
Date: Tue, 16 Mar 2010 15:49:45 +0800

> BTW, is it OK if the patch can only apply on net-2.6 tree cleanly,
> but have some Hunks applying to stable kernel? If it is intended
> for both net-2.6 and stable kernel.

Sure.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH net-2.6 3/3] jme: Advance driver version number
  2010-03-17 10:09 ` [PATCH net-2.6 2/3] jme: Protect vlgrp structure by pause RX actions cooldavid
@ 2010-03-17 10:09   ` cooldavid
  2010-03-19  4:14     ` David Miller
  0 siblings, 1 reply; 8+ messages in thread
From: cooldavid @ 2010-03-17 10:09 UTC (permalink / raw)
  To: David Miller
  Cc: Guo-Fu Tseng, linux-netdev, Ethan Hsiao, Devinchiu, Hsiu-Che Chao

From: Guo-Fu Tseng <cooldavid@cooldavid.org>

Advance driver version number after some bug fix.

Signed-off-by: Guo-Fu Tseng <cooldavid@cooldavid.org>
---
 drivers/net/jme.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/net/jme.h b/drivers/net/jme.h
index c19db91..07ad3a4 100644
--- a/drivers/net/jme.h
+++ b/drivers/net/jme.h
@@ -25,7 +25,7 @@
 #define __JME_H_INCLUDED__
 
 #define DRV_NAME	"jme"
-#define DRV_VERSION	"1.0.5"
+#define DRV_VERSION	"1.0.6"
 #define PFX		DRV_NAME ": "
 
 #define PCI_DEVICE_ID_JMICRON_JMC250	0x0250
-- 
1.6.4.4


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH net-2.6 3/3] jme: Advance driver version number
  2010-03-17 10:09   ` [PATCH net-2.6 3/3] jme: Advance driver version number cooldavid
@ 2010-03-19  4:14     ` David Miller
  0 siblings, 0 replies; 8+ messages in thread
From: David Miller @ 2010-03-19  4:14 UTC (permalink / raw)
  To: cooldavid; +Cc: netdev, ethanhsiao, devinchiu, hcchao

From: cooldavid@cooldavid.org
Date: Wed, 17 Mar 2010 18:09:31 +0800

> From: Guo-Fu Tseng <cooldavid@cooldavid.org>
> 
> Advance driver version number after some bug fix.
> 
> Signed-off-by: Guo-Fu Tseng <cooldavid@cooldavid.org>

Applied.

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2010-03-19  4:14 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-15  5:15 [PATCH net-2.6 1/3] jme: Fix VLAN memory leak cooldavid
2010-03-15  5:15 ` [PATCH net-2.6 2/3] jme: Adding lock to protect vlgrp structure cooldavid
2010-03-15  5:15   ` [PATCH net-2.6 3/3] jme: Advance driver version number cooldavid
2010-03-15 22:54   ` [PATCH net-2.6 2/3] jme: Adding lock to protect vlgrp structure David Miller
2010-03-16  7:49     ` Guo-Fu Tseng
2010-03-16  7:55       ` David Miller
  -- strict thread matches above, loose matches on Subject: below --
2010-03-17 10:09 [PATCH net-2.6 1/3] jme: Fix VLAN memory leak cooldavid
2010-03-17 10:09 ` [PATCH net-2.6 2/3] jme: Protect vlgrp structure by pause RX actions cooldavid
2010-03-17 10:09   ` [PATCH net-2.6 3/3] jme: Advance driver version number cooldavid
2010-03-19  4:14     ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).