提交 7767e126 编写于 作者: P Paolo Galtieri 提交者: Linus Torvalds

[PATCH] IPMI oops fix

While doing some testing I discovered that if the BIOS on a board does not
properly setup the DMI information it leads to a panic in the IPMI code.

The panic is due to dereferencing a pointer which is not initialized.  The
pointer is initialized in port_setup() and/or mem_setup() and used in
init_one_smi() and cleanup_one_si(), however if either port_setup() or
mem_setup() return ENODEV the pointer does not get initialized.
Signed-off-by: NPaolo Galtieri <pgaltieri@mvista.com>
Acked-by: NCorey Minyard <cminyard@mvista.com>
Signed-off-by: NAndrew Morton <akpm@osdl.org>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 ebbd1bce
...@@ -2399,6 +2399,7 @@ static int init_one_smi(int intf_num, struct smi_info **smi) ...@@ -2399,6 +2399,7 @@ static int init_one_smi(int intf_num, struct smi_info **smi)
new_smi->handlers->cleanup(new_smi->si_sm); new_smi->handlers->cleanup(new_smi->si_sm);
kfree(new_smi->si_sm); kfree(new_smi->si_sm);
} }
if (new_smi->io_cleanup)
new_smi->io_cleanup(new_smi); new_smi->io_cleanup(new_smi);
return rv; return rv;
...@@ -2518,6 +2519,7 @@ static void __exit cleanup_one_si(struct smi_info *to_clean) ...@@ -2518,6 +2519,7 @@ static void __exit cleanup_one_si(struct smi_info *to_clean)
kfree(to_clean->si_sm); kfree(to_clean->si_sm);
if (to_clean->io_cleanup)
to_clean->io_cleanup(to_clean); to_clean->io_cleanup(to_clean);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册