Skip to content

Commit bab383d

Browse files
sudipm-mukherjeegregkh
authored andcommitted
auxdisplay: ks0108: fix refcount
parport_find_base() will implicitly do parport_get_port() which increases the refcount. Then parport_register_device() will again increment the refcount. But while unloading the module we are only doing parport_unregister_device() decrementing the refcount only once. We add an parport_put_port() to neutralize the effect of parport_get_port(). Cc: <[email protected]> # 2.6.32+ Signed-off-by: Sudip Mukherjee <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent d25ded8 commit bab383d

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/auxdisplay/ks0108.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ static int __init ks0108_init(void)
139139

140140
ks0108_pardevice = parport_register_device(ks0108_parport, KS0108_NAME,
141141
NULL, NULL, NULL, PARPORT_DEV_EXCL, NULL);
142+
parport_put_port(ks0108_parport);
142143
if (ks0108_pardevice == NULL) {
143144
printk(KERN_ERR KS0108_NAME ": ERROR: "
144145
"parport didn't register new device\n");

0 commit comments

Comments
 (0)