public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
* [patch 9/9] ThinkPad ACPI: fix possible NULL pointer dereference
@ 2008-04-18 20:27 akpm
  2008-04-29  8:16 ` Len Brown
  0 siblings, 1 reply; 2+ messages in thread
From: akpm @ 2008-04-18 20:27 UTC (permalink / raw)
  To: lenb; +Cc: linux-acpi, akpm, gorcunov, hmh

From: Cyrill Gorcunov <gorcunov@gmail.com>

Fix potential NULL pointer dereference if kstrdup failed

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Acked-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 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-dereference drivers/misc/thinkpad_acpi.c
--- a/drivers/misc/thinkpad_acpi.c~thinkpad-acpi-fix-possible-null-pointer-dereference
+++ a/drivers/misc/thinkpad_acpi.c
@@ -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;
 	}
_

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

* Re: [patch 9/9] ThinkPad ACPI: fix possible NULL pointer dereference
  2008-04-18 20:27 [patch 9/9] ThinkPad ACPI: fix possible NULL pointer dereference akpm
@ 2008-04-29  8:16 ` Len Brown
  0 siblings, 0 replies; 2+ messages in thread
From: Len Brown @ 2008-04-29  8:16 UTC (permalink / raw)
  To: akpm; +Cc: linux-acpi, gorcunov, hmh

applied

thanks,
-len

On Friday 18 April 2008, akpm@linux-foundation.org wrote:
> From: Cyrill Gorcunov <gorcunov@gmail.com>
> 
> Fix potential NULL pointer dereference if kstrdup failed
> 
> Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
> Acked-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
> ---
> 
>  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-dereference drivers/misc/thinkpad_acpi.c
> --- a/drivers/misc/thinkpad_acpi.c~thinkpad-acpi-fix-possible-null-pointer-dereference
> +++ a/drivers/misc/thinkpad_acpi.c
> @@ -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 majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 



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

end of thread, other threads:[~2008-04-29  8:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-04-18 20:27 [patch 9/9] ThinkPad ACPI: fix possible NULL pointer dereference akpm
2008-04-29  8:16 ` Len Brown

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