diff options
Diffstat (limited to 'drivers/hid')
-rw-r--r-- | drivers/hid/hid-core.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c index d34eb34dbe25..d98332b11009 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; } |