Skip to content

Commit

Permalink
parport_pc: make sure to release IO ports after probing for IT87XX
Browse files Browse the repository at this point in the history
Commit f63fd7e ("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 <[email protected]>
Cc: Jan Kara <[email protected]>
Cc: Petr Cvek <[email protected]>
Acked-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
torvalds committed Apr 4, 2008
1 parent e315c12 commit 4ed9190
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/parport/parport_pc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1568,9 +1568,8 @@ static void __devinit detect_and_report_it87(void)
outb(r | 8, 0x2F);
outb(0x02, 0x2E); /* Lock */
outb(0x02, 0x2F);

release_region(0x2e, 1);
}
release_region(0x2e, 1);
}
#endif /* CONFIG_PARPORT_PC_SUPERIO */

Expand Down

0 comments on commit 4ed9190

Please sign in to comment.