Re: [PATCH] softdog.c (was: Kernel panic after rmmod softdog (2.6.8.1))

From: Arnd Bergmann
Date: Mon Oct 11 2004 - 15:04:56 EST


On Maandag 11 Oktober 2004 19:01, Chuck Ebbert wrote:

> --- linux-2.6.8.1/drivers/char/watchdog/softdog.c.orig Sun Oct 10 23:08:24 2004
> +++ linux-2.6.8.1/drivers/char/watchdog/softdog.c Sun Oct 10 23:10:12 2004
> @@ -135,8 +135,9 @@
> {
> if(test_and_set_bit(0, &timer_alive))
> return -EBUSY;
> - if (nowayout)
> - __module_get(THIS_MODULE);
> +
> + __module_get(THIS_MODULE);
> +
> /*
> * Activate timer
> */
> @@ -152,6 +153,7 @@
> */
> if (expect_close == 42) {
> softdog_stop();
> + module_put(THIS_MODULE);
> } else {
> printk(KERN_CRIT PFX "Unexpected close, not stopping watchdog!\n");
> softdog_keepalive();
>
Now if you do open(), close(), open(), write("V"), close(), the module
becomes unremovable, even without nowayout=1. Isn't is possible to
simply add a softdog_stop() call to watchdog_exit()?

Arnd <><

Attachment: pgp00000.pgp
Description: signature