We recently introduced locking into this function, but we missed an
error path which needs an unlock.
Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
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) {
if (ret)
hdev->driver = NULL;
}
-
+unlock:
up(&hdev->driver_lock);
return ret;
}