提交 397f4ebf 编写于 作者: J Jeff Garzik 提交者: Linus Torvalds

[PATCH] ipmi: fix uninitialized data bug

gcc issues the following warning:

drivers/char/ipmi/ipmi_si_intf.c: In function ‘init_ipmi_si’:
drivers/char/ipmi/ipmi_si_intf.c:1729: warning: ‘data.irq’ may be used uninitialized in this function

This is indeed a bug.  data.irq is completely uninitialized in some code
paths.  Worse than that, data from a previous decode_dmi() run can easily
leak through successive calls.
Signed-off-by: NJeff Garzik <jeff@garzik.org>
Acked-by: NCorey Minyard <minyard@acm.org>
Signed-off-by: NAndrew Morton <akpm@osdl.org>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 c3b65713
......@@ -1734,6 +1734,7 @@ static void __devinit dmi_find_bmc(void)
int rv;
while ((dev = dmi_find_device(DMI_DEV_TYPE_IPMI, NULL, dev))) {
memset(&data, 0, sizeof(data));
rv = decode_dmi((struct dmi_header *) dev->device_data, &data);
if (!rv)
try_init_dmi(&data);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册