linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] atm: idt77252: fix dev refcnt leak
@ 2013-11-19 10:09 Ying Xue
  2013-11-19 20:53 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Ying Xue @ 2013-11-19 10:09 UTC (permalink / raw)
  To: chas; +Cc: linux-atm-general, netdev, linux-kernel, ying.xue

init_card() calls dev_get_by_name() to get a network deceive. But it
doesn't decrease network device reference count after the device is
used.

Signed-off-by: Ying Xue <ying.xue@windriver.com>
---
 drivers/atm/idt77252.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/atm/idt77252.c b/drivers/atm/idt77252.c
index 272f009..1bdf104 100644
--- a/drivers/atm/idt77252.c
+++ b/drivers/atm/idt77252.c
@@ -3511,7 +3511,7 @@ static int init_card(struct atm_dev *dev)
 	tmp = dev_get_by_name(&init_net, tname);	/* jhs: was "tmp = dev_get(tname);" */
 	if (tmp) {
 		memcpy(card->atmdev->esi, tmp->dev_addr, 6);
-
+		dev_put(tmp);
 		printk("%s: ESI %pM\n", card->name, card->atmdev->esi);
 	}
 	/*
-- 
1.7.9.5


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

* Re: [PATCH] atm: idt77252: fix dev refcnt leak
  2013-11-19 10:09 [PATCH] atm: idt77252: fix dev refcnt leak Ying Xue
@ 2013-11-19 20:53 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2013-11-19 20:53 UTC (permalink / raw)
  To: ying.xue; +Cc: chas, linux-atm-general, netdev, linux-kernel

From: Ying Xue <ying.xue@windriver.com>
Date: Tue, 19 Nov 2013 18:09:27 +0800

> init_card() calls dev_get_by_name() to get a network deceive. But it
> doesn't decrease network device reference count after the device is
> used.
> 
> Signed-off-by: Ying Xue <ying.xue@windriver.com>

Applied and queued up for -stable, thanks.

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

end of thread, other threads:[~2013-11-19 20:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-11-19 10:09 [PATCH] atm: idt77252: fix dev refcnt leak Ying Xue
2013-11-19 20:53 ` 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).