浏览代码

[PATCH] broken error path in drivers/pnp/card.c

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>
Jaroslav Kysela 20 年之前
父节点
当前提交
30d5b64b63
共有 1 个文件被更改,包括 2 次插入0 次删除
  1. 2 0
      drivers/pnp/card.c

+ 2 - 0
drivers/pnp/card.c

@@ -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;
 		}
 	}