Skip to content

Commit

Permalink
netconsole: enable netconsole can make net_device refcnt incorrent
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Gao feng authored and davem330 committed Oct 19, 2011
1 parent 6230c9b commit d512348
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions drivers/net/netconsole.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */

Expand Down

0 comments on commit d512348

Please sign in to comment.