提交 ba623a77 编写于 作者: D Dan Carpenter 提交者: Jiri Kosina

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: NDan Carpenter <error27@gmail.com>
Signed-off-by: NJiri Kosina <jkosina@suse.cz>
上级 54d3339a
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册