public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] platform/x86: hp_accel: Fix an error handling path in 'lis3lv02d_probe()'
@ 2021-11-07 19:57 Christophe JAILLET
  2021-11-08 19:48 ` Mark Gross
  2021-11-11  9:50 ` Hans de Goede
  0 siblings, 2 replies; 4+ messages in thread
From: Christophe JAILLET @ 2021-11-07 19:57 UTC (permalink / raw)
  To: eric.piel, hdegoede, markgross, dmitry.torokhov, giedriuswork,
	dvhart, akpm, pavel
  Cc: platform-driver-x86, linux-kernel, kernel-janitors,
	Christophe JAILLET

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: a4c724d0723b ("platform: hp_accel: add a i8042 filter to remove HPQ6000 data from kb bus stream")
Fixes: 9e0c79782143 ("lis3lv02d: merge with leds hp disk")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
 drivers/platform/x86/hp_accel.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/platform/x86/hp_accel.c b/drivers/platform/x86/hp_accel.c
index b183967ecfb7..435a91fe2568 100644
--- a/drivers/platform/x86/hp_accel.c
+++ b/drivers/platform/x86/hp_accel.c
@@ -331,9 +331,11 @@ static int lis3lv02d_probe(struct platform_device *device)
 	INIT_WORK(&hpled_led.work, delayed_set_status_worker);
 	ret = led_classdev_register(NULL, &hpled_led.led_classdev);
 	if (ret) {
+		i8042_remove_filter(hp_accel_i8042_filter);
 		lis3lv02d_joystick_disable(&lis3_dev);
 		lis3lv02d_poweroff(&lis3_dev);
 		flush_work(&hpled_led.work);
+		lis3lv02d_remove_fs(&lis3_dev);
 		return ret;
 	}
 
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-11-11  9:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-11-07 19:57 [PATCH] platform/x86: hp_accel: Fix an error handling path in 'lis3lv02d_probe()' Christophe JAILLET
2021-11-08 19:48 ` Mark Gross
2021-11-08 20:09   ` Christophe JAILLET
2021-11-11  9:50 ` Hans de Goede

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox