[WATCHDOG] Semi-typical watchdog bug re early misc_register()
authorAlexey Dobriyan <adobriyan@gmail.com>
Sat, 24 Mar 2007 12:58:12 +0000 (15:58 +0300)
committerWim Van Sebroeck <wim@iguana.be>
Mon, 26 Mar 2007 20:26:11 +0000 (20:26 +0000)
commitfb8f7ba077b5c665432082ab205bcd2cb01f6a3c
tree13a956eb9a1723bd3d5463230acbfc6513f3b034
parent0e94f2ee0d1947ba6c2c00c3e971ff93ce8edec1
[WATCHDOG] Semi-typical watchdog bug re early misc_register()

It seems that some watchdog drivers are doing following mistake:

rv = misc_register();
if (rv < 0)
return rv;
rv = request_region();
if (rv < 0) {
misc_deregister();
return rv;
}

But, right after misc_register() returns, misc device can be opened and
ioctls interacting with hardware issued, and driver can do outb() to
port it doesn't own yet, because request_region() is still pending.

Here is my patch, compile-tested only.

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
drivers/char/watchdog/cpu5wdt.c
drivers/char/watchdog/eurotechwdt.c
drivers/char/watchdog/ibmasr.c
drivers/char/watchdog/machzwd.c
drivers/char/watchdog/sbc8360.c