Skip to contentSkip to conversation

platform-drivers-x86: msi-wmi: add missing sparse_keymap_free in msi_wmi_init error path

PATCH In review Axel Lin 3 participants 4 messages Jul 6, 2011

Subsystems (2)
lore
Share & tools
lore

Axel Lin

author
#0 lore raw

PATCH 1/1 platform-drivers-x86: msi-wmi: add missing sparse_keymap_free in msi_wmi_init error path

---
 drivers/platform/x86/msi-wmi.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
drivers/platform/x86/msi-wmi.c +1 -0
index c832e33..6f40bf2 100644
@@ -272,6 +272,7 @@ static int __init msi_wmi_init(void)
 err_free_backlight:
 	backlight_device_unregister(backlight);
 err_free_input:
+	sparse_keymap_free(msi_wmi_input_dev);
 	input_unregister_device(msi_wmi_input_dev);
 err_uninstall_notifier:
 	wmi_remove_notify_handler(MSIWMI_EVENT_GUID);
Signature · 1 line
1.7.4.1
Acked-by on v1 1/1
#1 lore raw
Quoted 10 lines · Axel Lin
---
 drivers/platform/x86/msi-wmi.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
drivers/platform/x86/msi-wmi.c +0 -0
index c832e33..6f40bf2 100644

drivers/platform/x86/msi-wmi.c static int __init msi_wmi_init(void) · line 276

Quoted 5 lines
drivers/platform/x86/msi-wmi.c +1 -0
@@ -272,6 +272,7 @@ static int __init msi_wmi_init(void)
 err_free_backlight:
 	backlight_device_unregister(backlight);
 err_free_input:
+	sparse_keymap_free(msi_wmi_input_dev);
 	input_unregister_device(msi_wmi_input_dev);

Nice catch ! Maybe doing the init in two different functions wasn't the best for error handling.

PS: It might already have been asked, but what's your secret Axel ? Do you use static/dynamic analysis tools ? Which ones ?

author
#2 lore raw
Quoted 4 lines

PS: It might already have been asked, but what's your secret Axel ? Do you use static/dynamic analysis tools ? Which ones ?

Actually, I just read the code.
I don't use any special analysis tool, maybe just use grep.

Regards,
Axel

Acked-by on v1 1/1
#3 lore raw
In reply to Axel Lin
Quoted 1 line · Axel Lin
Quoted 21 lines
---
 drivers/platform/x86/msi-wmi.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
drivers/platform/x86/msi-wmi.c +1 -0
index c832e33..6f40bf2 100644
@@ -272,6 +272,7 @@ static int __init msi_wmi_init(void)
 err_free_backlight:
 	backlight_device_unregister(backlight);
 err_free_input:
+	sparse_keymap_free(msi_wmi_input_dev);
 	input_unregister_device(msi_wmi_input_dev);
 err_uninstall_notifier:
 	wmi_remove_notify_handler(MSIWMI_EVENT_GUID);
Signature · 1 line
1.7.4.1
Signature · 1 line
Dmitry