struct config_item item;
#endif
int enabled;
+ struct mutex mutex;
struct netpoll np;
};
strlcpy(nt->np.dev_name, "eth0", IFNAMSIZ);
nt->np.local_port = 6665;
nt->np.remote_port = 6666;
+ mutex_init(&nt->mutex);
memset(nt->np.remote_mac, 0xff, ETH_ALEN);
/* Parse parameters and setup netpoll */
return -EINVAL;
}
+ mutex_lock(&nt->mutex);
if (enabled) { /* 1 */
/*
netpoll_print_options(&nt->np);
err = netpoll_setup(&nt->np);
- if (err)
+ if (err) {
+ mutex_unlock(&nt->mutex);
return err;
+ }
printk(KERN_INFO "netconsole: network logging started\n");
}
nt->enabled = enabled;
+ mutex_unlock(&nt->mutex);
return strnlen(buf, count);
}
strlcpy(nt->np.dev_name, "eth0", IFNAMSIZ);
nt->np.local_port = 6665;
nt->np.remote_port = 6666;
+ mutex_init(&nt->mutex);
memset(nt->np.remote_mac, 0xff, ETH_ALEN);
/* Initialize the config_item member */
* we might sleep in __netpoll_cleanup()
*/
spin_unlock_irqrestore(&target_list_lock, flags);
+
+ mutex_lock(&nt->mutex);
__netpoll_cleanup(&nt->np);
+ mutex_unlock(&nt->mutex);
+
spin_lock_irqsave(&target_list_lock, flags);
dev_put(nt->np.dev);
nt->np.dev = NULL;