mirror of
https://github.com/torvalds/linux.git
synced 2024-11-29 15:41:36 +00:00
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 <error27@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
This commit is contained in:
parent
54d3339ac1
commit
ba623a774f
@ -1642,8 +1642,10 @@ static int hid_device_probe(struct device *dev)
|
|||||||
|
|
||||||
if (!hdev->driver) {
|
if (!hdev->driver) {
|
||||||
id = hid_match_device(hdev, hdrv);
|
id = hid_match_device(hdev, hdrv);
|
||||||
if (id == NULL)
|
if (id == NULL) {
|
||||||
return -ENODEV;
|
ret = -ENODEV;
|
||||||
|
goto unlock;
|
||||||
|
}
|
||||||
|
|
||||||
hdev->driver = hdrv;
|
hdev->driver = hdrv;
|
||||||
if (hdrv->probe) {
|
if (hdrv->probe) {
|
||||||
@ -1656,7 +1658,7 @@ static int hid_device_probe(struct device *dev)
|
|||||||
if (ret)
|
if (ret)
|
||||||
hdev->driver = NULL;
|
hdev->driver = NULL;
|
||||||
}
|
}
|
||||||
|
unlock:
|
||||||
up(&hdev->driver_lock);
|
up(&hdev->driver_lock);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user