]> err.no Git - linux-2.6/commitdiff
[PATCH] broken error path in drivers/pnp/card.c
authorJaroslav Kysela <perex@suse.cz>
Thu, 18 Aug 2005 11:16:11 +0000 (13:16 +0200)
committerLinus Torvalds <torvalds@g5.osdl.org>
Thu, 18 Aug 2005 15:43:59 +0000 (08:43 -0700)
The error path in pnp_request_card_device() is broken (one variable is
left initialized and the semaphore is not unlocked).

This fixes it (and has been tested).

Signed-off-by: Jaroslav Kysela <perex@suse.cz>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
drivers/pnp/card.c

index add12f7c489a9666b53983c13077505465c33bd4..6e5229e92fbc7bc9fa6a443a9f78fff7f9867b32 100644 (file)
@@ -312,6 +312,8 @@ found:
        if (drv->link.driver.probe) {
                if (drv->link.driver.probe(&dev->dev)) {
                        dev->dev.driver = NULL;
+                       dev->card_link = NULL;
+                       up_write(&dev->dev.bus->subsys.rwsem);
                        return NULL;
                }
        }