Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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 <gaofeng@cn.fujitsu.com>
Acked-by: default avatarFlavio Leitner <fbl@redhat.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 6230c9b4
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -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 */