diff options
author | Gao feng <gaofeng@cn.fujitsu.com> | 2011-10-11 16:08:11 +0000 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-11-11 09:36:27 -0800 |
commit | 18743353b3154f0ff7c29f3c5ae3a8466a70d73a (patch) | |
tree | cd647b83853135d4481a93cb1185647a2972a720 /drivers/net/netconsole.c | |
parent | 89c32c14c190c6113187c7c57784695701e314e4 (diff) |
netconsole: enable netconsole can make net_device refcnt incorrent
[ 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>
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, return err; if (enabled < 0 || enabled > 1) return -EINVAL; + if (enabled == nt->enabled) { + printk(KERN_INFO "netconsole: network logging has already %s\n", + nt->enabled ? "started" : "stopped"); + return -EINVAL; + } if (enabled) { /* 1 */ |