Skip to content

Commit c961a7d

Browse files
tititiou36jwrdegoede
authored andcommitted
platform/x86: hp_accel: Fix an error handling path in 'lis3lv02d_probe()'
If 'led_classdev_register()' fails, some additional resources should be released. Add the missing 'i8042_remove_filter()' and 'lis3lv02d_remove_fs()' calls that are already in the remove function but are missing here. Fixes: a4c724d ("platform: hp_accel: add a i8042 filter to remove HPQ6000 data from kb bus stream") Fixes: 9e0c797 ("lis3lv02d: merge with leds hp disk") Signed-off-by: Christophe JAILLET <[email protected]> Link: https://lore.kernel.org/r/5a4f218f8f16d2e3a7906b7ca3654ffa946895f8.1636314074.git.christophe.jaillet@wanadoo.fr Reviewed-by: Hans de Goede <[email protected]> Signed-off-by: Hans de Goede <[email protected]>
1 parent 707f0c2 commit c961a7d

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/platform/x86/hp_accel.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -331,9 +331,11 @@ static int lis3lv02d_probe(struct platform_device *device)
331331
INIT_WORK(&hpled_led.work, delayed_set_status_worker);
332332
ret = led_classdev_register(NULL, &hpled_led.led_classdev);
333333
if (ret) {
334+
i8042_remove_filter(hp_accel_i8042_filter);
334335
lis3lv02d_joystick_disable(&lis3_dev);
335336
lis3lv02d_poweroff(&lis3_dev);
336337
flush_work(&hpled_led.work);
338+
lis3lv02d_remove_fs(&lis3_dev);
337339
return ret;
338340
}
339341

0 commit comments

Comments
 (0)