netconsole: enable netconsole can make net_device refcnt incorrent
Subsystems (3)
PATCH v2 1/1 netconsole: enable netconsole can make net_device refcnt incorrent
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 <[email protected]>
--- drivers/net/netconsole.c | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-)
drivers/net/netconsole.c +5 -0
@@ -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 */
Signature · 1 line
1.7.1
Quoted 8 lines · On Wed, 12 Oct 2011 10:08:11 +0800 Gao feng <[email protected]> wrote:
There is no check if netconsole is enabled current. so when exec echo 1 > enabled;
the reference ofnet_devicewill increment always.Signed-off-by Gao feng <[email protected]>--- drivers/net/netconsole.c | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-)
Looks better, thanks!
Acked-by Flavio Leitner <[email protected]>
fbl
From: Flavio Leitner <[email protected]>
Date: Wed, 12 Oct 2011 10:23:44 -0300
Quoted 7 lines
Quoted 4 lines · On Wed, 12 Oct 2011 10:08:11 +0800 Gao feng <[email protected]> wrote:
There is no check if netconsole is enabled current. so when exec echo 1 > enabled;
the reference ofnet_devicewill increment always.
Quoted 7 lines
Quoted 4 lines
Signed-off-by Gao feng <[email protected]>--- drivers/net/netconsole.c | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-)Looks better, thanks!
Acked-by Flavio Leitner <[email protected]>
Applied, thanks everyone.