From: Gao feng <gaofeng@cn•fujitsu.com>
To: netdev@vger•kernel.org
Cc: davem@davemloft•net, eric.dumazet@gmail•com
Subject: [PATCH] netconsole: enable netconsole can make net_device refcnt incorrent
Date: Tue, 11 Oct 2011 14:29:12 +0800 [thread overview]
Message-ID: <4E93E238.7000105@cn.fujitsu.com> (raw)
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
next reply other threads:[~2011-10-11 6:28 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-11 6:29 Gao feng [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4E93E238.7000105@cn.fujitsu.com \
--to=gaofeng@cn$(echo .)fujitsu.com \
--cc=davem@davemloft$(echo .)net \
--cc=eric.dumazet@gmail$(echo .)com \
--cc=netdev@vger$(echo .)kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox