Commit 159226d1 authored by Daniel Ritz's avatar Daniel Ritz Committed by Chris Wright

[PATCH] pcmcia: fix 'rmmod pcmcia' with unbound devices

Having unbound PCMCIA devices: doing a 'find /sys' after a 'rmmod pcmcia'
gives an oops because the pcmcia_device is not unregisterd from the driver
core.

fixes bugzilla #7481
Signed-off-by: default avatarDaniel Ritz <daniel.ritz@gmx.ch>
Acked-by: default avatarDominik Brodowski <linux@dominikbrodowski.net>
Cc: Pavol Gono <Palo.Gono@gmail.com>
Cc: <stable@kernel.org>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
[chrisw: add subsequent mutex fix]
Signed-off-by: default avatarChris Wright <chrisw@sous-sol.org>
parent a5812a61
......@@ -1264,6 +1264,11 @@ static void pcmcia_bus_remove_socket(struct class_device *class_dev,
socket->pcmcia_state.dead = 1;
pccard_register_pcmcia(socket, NULL);
/* unregister any unbound devices */
mutex_lock(&socket->skt_mutex);
pcmcia_card_remove(socket, NULL);
mutex_unlock(&socket->skt_mutex);
pcmcia_put_socket(socket);
return;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment