summaryrefslogtreecommitdiffstats
path: root/drivers/staging/ipack/devices
diff options
context:
space:
mode:
authorSamuel Iglesias Gonsalvez2012-05-25 10:03:03 +0200
committerGreg Kroah-Hartman2012-06-07 07:20:29 +0200
commit597d473f163a1672262b845ede8a65afdf1b27c6 (patch)
tree2484486e4f0808d3ba2c7033f9ae9e840d922a90 /drivers/staging/ipack/devices
parentStaging: ipack: delete the call to remove() in ipack_driver_register (diff)
downloadkernel-qcow2-linux-597d473f163a1672262b845ede8a65afdf1b27c6.tar.gz
kernel-qcow2-linux-597d473f163a1672262b845ede8a65afdf1b27c6.tar.xz
kernel-qcow2-linux-597d473f163a1672262b845ede8a65afdf1b27c6.zip
Staging: ipack/devices/ipoctal: avoid kernel oops when uninstalling
When uninstalling a device, there is a loop of calls that produces, at the end, two calls to __ipoctal_remove() function with the same ipack_device argument. The first time works fine, but the second will fail in tty_unregister_driver() To avoid this situation, the call to __ipoctal_remove() it is done only from the ipack bus driver and not from the ipack device driver. Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/ipack/devices')
-rw-r--r--drivers/staging/ipack/devices/ipoctal.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/drivers/staging/ipack/devices/ipoctal.c b/drivers/staging/ipack/devices/ipoctal.c
index 29f6fa841d23..a6f424e65e39 100644
--- a/drivers/staging/ipack/devices/ipoctal.c
+++ b/drivers/staging/ipack/devices/ipoctal.c
@@ -853,11 +853,6 @@ static void __ipoctal_remove(struct ipoctal *ipoctal)
tty_unregister_driver(ipoctal->tty_drv);
put_tty_driver(ipoctal->tty_drv);
-
- /* Tell the carrier board to free all the resources for this device */
- if (ipoctal->dev->bus->ops->remove_device != NULL)
- ipoctal->dev->bus->ops->remove_device(ipoctal->dev);
-
list_del(&ipoctal->list);
kfree(ipoctal);
}
@@ -889,7 +884,7 @@ static void __exit ipoctal_exit(void)
struct ipoctal *p, *next;
list_for_each_entry_safe(p, next, &ipoctal_list, list)
- __ipoctal_remove(p);
+ p->dev->bus->ops->remove_device(p->dev);
ipack_driver_unregister(&driver);
}