Add patches accepted for 2.6.26-rc1
[linux-2.6/linux-acpi-2.6/ibm-acpi-2.6.git] / releases / upstream / 2.6.26-rc1 / 0001-thinkpad_acpi-fix-possible-NULL-pointer-dereference.patch
blob8e59a2dabfa9e004227f407d29ad5cc615607486
1 From 90fe17f4df2f830601ffd422b11d1f7f9a9d0355 Mon Sep 17 00:00:00 2001
2 From: Cyrill Gorcunov <gorcunov@gmail.com>
3 Date: Fri, 18 Apr 2008 13:27:29 -0700
4 Subject: thinkpad_acpi: fix possible NULL pointer dereference if kstrdup failed
6 Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
7 Acked-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
8 Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
9 Signed-off-by: Len Brown <len.brown@intel.com>
10 ---
11 drivers/misc/thinkpad_acpi.c | 2 +-
12 1 files changed, 1 insertions(+), 1 deletions(-)
14 diff --git a/drivers/misc/thinkpad_acpi.c b/drivers/misc/thinkpad_acpi.c
15 index 6cb7812..31115c9 100644
16 --- a/drivers/misc/thinkpad_acpi.c
17 +++ b/drivers/misc/thinkpad_acpi.c
18 @@ -5826,7 +5826,7 @@ static void __init get_thinkpad_model_data(struct thinkpad_id_data *tp)
20 tp->model_str = kstrdup(dmi_get_system_info(DMI_PRODUCT_VERSION),
21 GFP_KERNEL);
22 - if (strnicmp(tp->model_str, "ThinkPad", 8) != 0) {
23 + if (tp->model_str && strnicmp(tp->model_str, "ThinkPad", 8) != 0) {
24 kfree(tp->model_str);
25 tp->model_str = NULL;
27 --
28 1.5.4.4