From ba623a774f5b529f89b3d63e0837df52e16ffb3b Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Wed, 24 Aug 2011 14:27:46 +0300 Subject: HID: unlock on error path in hid_device_probe() We recently introduced locking into this function, but we missed an error path which needs an unlock. Signed-off-by: Dan Carpenter Signed-off-by: Jiri Kosina --- drivers/hid/hid-core.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'drivers/hid') diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c index d34eb34dbe2..d98332b1100 100644 --- a/drivers/hid/hid-core.c +++ b/drivers/hid/hid-core.c @@ -1642,8 +1642,10 @@ static int hid_device_probe(struct device *dev) if (!hdev->driver) { id = hid_match_device(hdev, hdrv); - if (id == NULL) - return -ENODEV; + if (id == NULL) { + ret = -ENODEV; + goto unlock; + } hdev->driver = hdrv; if (hdrv->probe) { @@ -1656,7 +1658,7 @@ static int hid_device_probe(struct device *dev) if (ret) hdev->driver = NULL; } - +unlock: up(&hdev->driver_lock); return ret; } -- cgit v1.2.3-18-g5258