aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/hid/hid-lenovo-tpkbd.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/drivers/hid/hid-lenovo-tpkbd.c b/drivers/hid/hid-lenovo-tpkbd.c
index 762d988548a2..31cf29a6ba17 100644
--- a/drivers/hid/hid-lenovo-tpkbd.c
+++ b/drivers/hid/hid-lenovo-tpkbd.c
@@ -414,22 +414,27 @@ static int tpkbd_probe(struct hid_device *hdev,
414 ret = hid_parse(hdev); 414 ret = hid_parse(hdev);
415 if (ret) { 415 if (ret) {
416 hid_err(hdev, "hid_parse failed\n"); 416 hid_err(hdev, "hid_parse failed\n");
417 goto err_free; 417 goto err;
418 } 418 }
419 419
420 ret = hid_hw_start(hdev, HID_CONNECT_DEFAULT); 420 ret = hid_hw_start(hdev, HID_CONNECT_DEFAULT);
421 if (ret) { 421 if (ret) {
422 hid_err(hdev, "hid_hw_start failed\n"); 422 hid_err(hdev, "hid_hw_start failed\n");
423 goto err_free; 423 goto err;
424 } 424 }
425 425
426 uhdev = (struct usbhid_device *) hdev->driver_data; 426 uhdev = (struct usbhid_device *) hdev->driver_data;
427 427
428 if (uhdev->ifnum == 1) 428 if (uhdev->ifnum == 1) {
429 return tpkbd_probe_tp(hdev); 429 ret = tpkbd_probe_tp(hdev);
430 if (ret)
431 goto err_hid;
432 }
430 433
431 return 0; 434 return 0;
432err_free: 435err_hid:
436 hid_hw_stop(hdev);
437err:
433 return ret; 438 return ret;
434} 439}
435 440