提交 90fe17f4 编写于 作者: C Cyrill Gorcunov 提交者: Len Brown

thinkpad_acpi: fix possible NULL pointer dereference if kstrdup failed

Signed-off-by: NCyrill Gorcunov <gorcunov@gmail.com>
Acked-by: NHenrique de Moraes Holschuh <hmh@hmh.eng.br>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLen Brown <len.brown@intel.com>
上级 a815ab8b
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册