]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
[PATCH] pcmcia: fix 'rmmod pcmcia' with unbound devices
authorDaniel Ritz <daniel.ritz-ml@swissonline.ch>
Sun, 19 Nov 2006 06:19:34 +0000 (22:19 -0800)
committerChris Wright <chrisw@sous-sol.org>
Sat, 2 Dec 2006 00:12:36 +0000 (16:12 -0800)
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: Daniel Ritz <daniel.ritz@gmx.ch>
Acked-by: Dominik Brodowski <linux@dominikbrodowski.net>
Cc: Pavol Gono <Palo.Gono@gmail.com>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
[chrisw: add subsequent mutex fix]
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
drivers/pcmcia/ds.c

index 74b3124e8247e444fd2911eecfe0de1ca5597063..95d5e880f8d85ddbdf5273f51ec33cbc006c1992 100644 (file)
@@ -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;