Commit d5123480 authored by Gao feng's avatar Gao feng Committed by David S. Miller
Browse files

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: default avatarGao feng <>
Acked-by: default avatarFlavio Leitner <>
Signed-off-by: default avatarDavid S. Miller <>
parent 6230c9b4
......@@ -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 */
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment