提交 20ecb499 编写于 作者: G Guenter Roeck

hwmon: (coretemp) Avoid leaving around dangling pointer

Storing the struct temp_data pointer allocated from create_core_data()
when returning an error has the potential of leaving around a pointer
to freed memory. Reset it to NULL for error returns.
Reported-by: NJan Beulich <jbeulich@suse.com>
Signed-off-by: NGuenter Roeck <guenter.roeck@ericsson.com>
Acked-by: NJean Delvare <khali@linux-fr.org>
上级 0eb9782a
......@@ -506,6 +506,7 @@ static int create_core_data(struct platform_device *pdev,
return 0;
exit_free:
pdata->core_data[attr_no] = NULL;
kfree(tdata);
return err;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册