aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--drivers/net/netconsole.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/net/netconsole.c b/drivers/net/netconsole.c
index ab8a0623b1a1..5ef680cf994a 100644
--- a/drivers/net/netconsole.c
+++ b/drivers/net/netconsole.c
@@ -344,7 +344,7 @@ static ssize_t enabled_store(struct config_item *item,
goto out_unlock;
err = -EINVAL;
- if ((bool)enabled == nt->enabled) {
+ if (enabled == nt->enabled) {
pr_info("network logging has already %s\n",
nt->enabled ? "started" : "stopped");
goto out_unlock;
@@ -369,6 +369,7 @@ static ssize_t enabled_store(struct config_item *item,
if (err)
goto out_unlock;
+ nt->enabled = true;
pr_info("network logging started\n");
} else { /* false */
/* We need to disable the netconsole before cleaning it up
@@ -381,8 +382,6 @@ static ssize_t enabled_store(struct config_item *item,
netpoll_cleanup(&nt->np);
}
- nt->enabled = enabled;
-
mutex_unlock(&dynamic_netconsole_mutex);
return strnlen(buf, count);
out_unlock: