diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-04-04 17:30:31 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-04-04 17:30:31 -0400 |
commit | 4ed919014eb2b591eb8fdd4dd00226a65faddef4 (patch) | |
tree | 468102fffdd30bb3110389b042df11e16235f29a /drivers/parport/parport_pc.c | |
parent | e315c121a858499d84dc88c499046b9f10bb61ec (diff) |
parport_pc: make sure to release IO ports after probing for IT87XX
Commit f63fd7e299ee13da071ecfce2b90b58c5e1562b1 ("parport_pc: detection
for SuperIO IT87XX POST") only released the IO port region on success,
not when the probe for the IT87XX chip failed.
That caused not only a reserved region to leak, but also caused an oops
when the driver module was unloaded and somebody tried to cat
/proc/ioports - because the string that was assigned to the IO port
region was a static string in the module virtual address area.
Reported-by: Lubos Lunak <l.lunak@suse.cz>
Cc: Jan Kara <jack@suse.cz>
Cc: Petr Cvek <petr.cvek@tul.cz>
Acked-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/parport/parport_pc.c')
-rw-r--r-- | drivers/parport/parport_pc.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/parport/parport_pc.c b/drivers/parport/parport_pc.c index d76d37bcb9cc..a85808938205 100644 --- a/drivers/parport/parport_pc.c +++ b/drivers/parport/parport_pc.c | |||
@@ -1568,9 +1568,8 @@ static void __devinit detect_and_report_it87(void) | |||
1568 | outb(r | 8, 0x2F); | 1568 | outb(r | 8, 0x2F); |
1569 | outb(0x02, 0x2E); /* Lock */ | 1569 | outb(0x02, 0x2E); /* Lock */ |
1570 | outb(0x02, 0x2F); | 1570 | outb(0x02, 0x2F); |
1571 | |||
1572 | release_region(0x2e, 1); | ||
1573 | } | 1571 | } |
1572 | release_region(0x2e, 1); | ||
1574 | } | 1573 | } |
1575 | #endif /* CONFIG_PARPORT_PC_SUPERIO */ | 1574 | #endif /* CONFIG_PARPORT_PC_SUPERIO */ |
1576 | 1575 | ||