diff options
author | Gao feng <gaofeng@cn.fujitsu.com> | 2011-10-11 12:08:11 -0400 |
---|---|---|
committer | Herton Ronaldo Krzesinski <herton.krzesinski@canonical.com> | 2011-11-21 12:55:05 -0500 |
commit | 2543ce825afd43753866c7559d1060a9ff6ff95f (patch) | |
tree | f7a31a26b1350984097b2a7cd5fd09de1d7b7d41 /drivers/net/netconsole.c | |
parent | 4b0a45588858c0a97e417721826d41506d503494 (diff) |
netconsole: enable netconsole can make net_device refcnt incorrent
BugLink: http://bugs.launchpad.net/bugs/890952
[ Upstream commit d5123480b1d6f7d1a5fe1a13520cef88fb5d4c84 ]
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>
Acked-by: Flavio Leitner <fbl@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Diffstat (limited to 'drivers/net/netconsole.c')
-rw-r--r-- | drivers/net/netconsole.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/net/netconsole.c b/drivers/net/netconsole.c index dfc82720065..4840ab7e7f8 100644 --- a/drivers/net/netconsole.c +++ b/drivers/net/netconsole.c | |||
@@ -307,6 +307,11 @@ static ssize_t store_enabled(struct netconsole_target *nt, | |||
307 | return err; | 307 | return err; |
308 | if (enabled < 0 || enabled > 1) | 308 | if (enabled < 0 || enabled > 1) |
309 | return -EINVAL; | 309 | return -EINVAL; |
310 | if (enabled == nt->enabled) { | ||
311 | printk(KERN_INFO "netconsole: network logging has already %s\n", | ||
312 | nt->enabled ? "started" : "stopped"); | ||
313 | return -EINVAL; | ||
314 | } | ||
310 | 315 | ||
311 | if (enabled) { /* 1 */ | 316 | if (enabled) { /* 1 */ |
312 | 317 | ||