[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20080416205248.GA3396@khazad-dum.debian.net>
Date: Wed, 16 Apr 2008 17:52:49 -0300
From: Henrique de Moraes Holschuh <hmh@....eng.br>
To: Cyrill Gorcunov <gorcunov@...il.com>
Cc: bfields@...ldses.org, neilb@...e.de, ibm-acpi@....eng.br,
len.brown@...el.com, kkeil@...e.de, akpm@...ux-foundation.org,
linux-kernel@...r.kernel.org
Subject: Re: [patch 3/3] ThinkPad ACPI: fix possible NULL pointer
dereference
On Wed, 16 Apr 2008, Cyrill Gorcunov wrote:
> Fix potential NULL pointer dereference if kstrdup failed
>
> Signed-off-by: Cyrill Gorcunov <gorcunov@...il.com>
Acked-by: Henrique de Moraes Holschuh <hmh@....eng.br>
> Index: linux-2.6.git/drivers/misc/thinkpad_acpi.c
> ===================================================================
> --- linux-2.6.git.orig/drivers/misc/thinkpad_acpi.c 2008-04-16 20:35:34.000000000 +0400
> +++ linux-2.6.git/drivers/misc/thinkpad_acpi.c 2008-04-16 20:36:38.000000000 +0400
> @@ -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;
> }
>
> --
--
"One disk to rule them all, One disk to find them. One disk to bring
them all and in the darkness grind them. In the Land of Redmond
where the shadows lie." -- The Silicon Valley Tarot
Henrique Holschuh
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists