ThinkPad ACPI: fix possible NULL pointer dereference
Subsystems (2)
PATCH 9/9 ThinkPad ACPI: fix possible NULL pointer dereference
From: Cyrill Gorcunov <[email protected]>
Fix potential NULL pointer dereference if kstrdup failed
Signed-off-by Cyrill Gorcunov <[email protected]>
Signed-off-by Andrew Morton <[email protected]>
---
drivers/misc/thinkpad_acpi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/misc/thinkpad_acpi.c renamed from drivers/misc/thinkpad_acpi.c~thinkpad-acpi-fix-possible-null-pointer-dereference +1 -1
@@ -5826,7 +5826,7 @@ static void __init get_thinkpad_model_da tp->model_str =kstrdup (dmi_get_system_info (DMI_PRODUCT_VERSION ),GFP_KERNEL ); -if (strnicmp (tp->model_str,"ThinkPad" ,8 ) !=0 ) { +if (tp->model_str &&strnicmp (tp->model_str,"ThinkPad" ,8 ) !=0 ) {kfree (tp->model_str); tp->model_str =NULL ; }
_
applied
thanks,
-len
Quoted 30 lines · On Friday 18 April 2008, [email protected] wrote:
From: Cyrill Gorcunov <[email protected]>
Fix potential NULL pointer dereference if kstrdup failed
Signed-off-by Cyrill Gorcunov <[email protected]>Signed-off-by Andrew Morton <[email protected]>---
drivers/misc/thinkpad_acpi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)diff -puN
drivers/misc/thinkpad_acpi.c~thinkpad-acpi-fix-possible-null-pointer-dereferencedrivers/misc/thinkpad_acpi.cdrivers/misc/thinkpad_acpi.c renamed from drivers/misc/thinkpad_acpi.c~thinkpad-acpi-fix-possible-null-pointer-dereference +1
-1@@ -5826,7 +5826,7 @@ static void __init get_thinkpad_model_da tp->model_str =kstrdup (dmi_get_system_info (DMI_PRODUCT_VERSION ),GFP_KERNEL ); -if (strnicmp (tp->model_str,"ThinkPad" ,8 ) !=0 ) { +if (tp->model_str &&strnicmp (tp->model_str,"ThinkPad" ,8 ) !=0 ) {kfree (tp->model_str); tp->model_str =NULL ; }_
--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html