提交 a057767e 编写于 作者: C Christophe JAILLET 提交者: Zheng Zengkai

platform/x86: hp_accel: Fix an error handling path in 'lis3lv02d_probe()'

stable inclusion
form stable-v5.10.82
commit d1f8f1e04a61f1e212ed294a0a7058a362063789
bugzilla: 185877 https://gitee.com/openeuler/kernel/issues/I4QU6V

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=d1f8f1e04a61f1e212ed294a0a7058a362063789

--------------------------------

[ Upstream commit c961a7d2 ]

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: a4c724d0 ("platform: hp_accel: add a i8042 filter to remove HPQ6000 data from kb bus stream")
Fixes: 9e0c7978 ("lis3lv02d: merge with leds hp disk")
Signed-off-by: NChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://lore.kernel.org/r/5a4f218f8f16d2e3a7906b7ca3654ffa946895f8.1636314074.git.christophe.jaillet@wanadoo.frReviewed-by: NHans de Goede <hdegoede@redhat.com>
Signed-off-by: NHans de Goede <hdegoede@redhat.com>
Signed-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: NChen Jun <chenjun102@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 8c750ddc
...@@ -372,9 +372,11 @@ static int lis3lv02d_add(struct acpi_device *device) ...@@ -372,9 +372,11 @@ static int lis3lv02d_add(struct acpi_device *device)
INIT_WORK(&hpled_led.work, delayed_set_status_worker); INIT_WORK(&hpled_led.work, delayed_set_status_worker);
ret = led_classdev_register(NULL, &hpled_led.led_classdev); ret = led_classdev_register(NULL, &hpled_led.led_classdev);
if (ret) { if (ret) {
i8042_remove_filter(hp_accel_i8042_filter);
lis3lv02d_joystick_disable(&lis3_dev); lis3lv02d_joystick_disable(&lis3_dev);
lis3lv02d_poweroff(&lis3_dev); lis3lv02d_poweroff(&lis3_dev);
flush_work(&hpled_led.work); flush_work(&hpled_led.work);
lis3lv02d_remove_fs(&lis3_dev);
return ret; return ret;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册