netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] netconsole: enable netconsole can make net_device refcnt incorrent
@ 2011-10-11  6:29 Gao feng
  2011-10-11  7:50 ` [PATCH] netconsole: enable netconsole can make net_device refcnt Wanlong Gao
  0 siblings, 1 reply; 5+ messages in thread
From: Gao feng @ 2011-10-11  6:29 UTC (permalink / raw)
  To: netdev; +Cc: davem, eric.dumazet

  There is no check if netconsole is enabled current.
so when exec echo 1 > enabled;
the reference of net_device will increment always.

Signed-off-by: Gao feng <gaofeng@cn.fujitsu.com>
---
  drivers/net/netconsole.c |    2 ++
  1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/net/netconsole.c b/drivers/net/netconsole.c
index ed2a397..4e6323d 100644
--- a/drivers/net/netconsole.c
+++ b/drivers/net/netconsole.c
@@ -307,6 +307,8 @@ static ssize_t store_enabled(struct 
netconsole_target *nt,
                 return err;
         if (enabled < 0 || enabled > 1)
                 return -EINVAL;
+       if (enabled == nt->enabled)
+               return err;

         if (enabled) {  /* 1 */

-- 
1.7.1

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

end of thread, other threads:[~2011-10-12  1:45 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-11  6:29 [PATCH] netconsole: enable netconsole can make net_device refcnt incorrent Gao feng
2011-10-11  7:50 ` [PATCH] netconsole: enable netconsole can make net_device refcnt Wanlong Gao
2011-10-11  8:05   ` Gao feng
2011-10-12  1:11     ` Flavio Leitner
2011-10-12  1:45       ` Gao feng

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