Skip to content

Commit ec2926f

Browse files
tititiou36Jiri Kosina
authored andcommitted
HID: nvidia-shield: Fix some missing function calls() in the probe error handling path
The commit in Fixes updated the error handling path of thunderstrike_create() and the remove function but not the error handling path of shield_probe(), should an error occur after a successful thunderstrike_create() call. Add the missing calls. Fixes: 3ab196f ("HID: nvidia-shield: Add battery support for Thunderstrike") Signed-off-by: Christophe JAILLET <[email protected]> Reviewed-by: Rahul Rameshbabu <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
1 parent 2ed20de commit ec2926f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

drivers/hid/hid-nvidia-shield.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1058,7 +1058,7 @@ static int shield_probe(struct hid_device *hdev, const struct hid_device_id *id)
10581058
ret = hid_hw_start(hdev, HID_CONNECT_HIDINPUT);
10591059
if (ret) {
10601060
hid_err(hdev, "Failed to start HID device\n");
1061-
goto err_haptics;
1061+
goto err_ts_create;
10621062
}
10631063

10641064
ret = hid_hw_open(hdev);
@@ -1073,10 +1073,12 @@ static int shield_probe(struct hid_device *hdev, const struct hid_device_id *id)
10731073

10741074
err_stop:
10751075
hid_hw_stop(hdev);
1076-
err_haptics:
1076+
err_ts_create:
1077+
power_supply_unregister(ts->base.battery_dev.psy);
10771078
if (ts->haptics_dev)
10781079
input_unregister_device(ts->haptics_dev);
10791080
led_classdev_unregister(&ts->led_dev);
1081+
ida_free(&thunderstrike_ida, ts->id);
10801082
return ret;
10811083
}
10821084

0 commit comments

Comments
 (0)