diff options
author | Cyrill Gorcunov <gorcunov@gmail.com> | 2008-04-18 20:27:29 (GMT) |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2008-04-29 14:10:03 (GMT) |
commit | 90fe17f4df2f830601ffd422b11d1f7f9a9d0355 (patch) | |
tree | f5e04bd8ea19125ed5217e41a6fb2dc3b992b5b2 /drivers/misc | |
parent | a815ab8b5891f3d2515316655729272f68269e3b (diff) | |
download | linux-90fe17f4df2f830601ffd422b11d1f7f9a9d0355.tar.xz |
thinkpad_acpi: fix possible 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>
Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/misc')
-rw-r--r-- | drivers/misc/thinkpad_acpi.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/misc/thinkpad_acpi.c b/drivers/misc/thinkpad_acpi.c index 6cb7812..31115c9 100644 --- a/drivers/misc/thinkpad_acpi.c +++ b/drivers/misc/thinkpad_acpi.c @@ -5826,7 +5826,7 @@ static void __init get_thinkpad_model_data(struct thinkpad_id_data *tp) 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; } |