summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorPaolo Galtieri <pgaltieri@mvista.com>2005-12-15 12:34:28 -0800
committerLinus Torvalds <torvalds@g5.osdl.org>2005-12-15 14:22:45 -0800
commit7767e126ca0f32cd0438455fdd9650f909d2eeb3 (patch)
treeefcad511a28e5b78db8d666c78636c55b664a1a0 /drivers
parentebbd1bce79b3b4778d9e1914a22c42fcfa869cd9 (diff)
downloadlinux-3.10-7767e126ca0f32cd0438455fdd9650f909d2eeb3.tar.gz
linux-3.10-7767e126ca0f32cd0438455fdd9650f909d2eeb3.tar.bz2
linux-3.10-7767e126ca0f32cd0438455fdd9650f909d2eeb3.zip
[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: Paolo Galtieri <pgaltieri@mvista.com> Acked-by: Corey Minyard <cminyard@mvista.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/char/ipmi/ipmi_si_intf.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/char/ipmi/ipmi_si_intf.c b/drivers/char/ipmi/ipmi_si_intf.c
index 01a1f6badb5..beea450ee4b 100644
--- a/drivers/char/ipmi/ipmi_si_intf.c
+++ b/drivers/char/ipmi/ipmi_si_intf.c
@@ -2399,7 +2399,8 @@ static int init_one_smi(int intf_num, struct smi_info **smi)
new_smi->handlers->cleanup(new_smi->si_sm);
kfree(new_smi->si_sm);
}
- new_smi->io_cleanup(new_smi);
+ if (new_smi->io_cleanup)
+ new_smi->io_cleanup(new_smi);
return rv;
}
@@ -2518,7 +2519,8 @@ static void __exit cleanup_one_si(struct smi_info *to_clean)
kfree(to_clean->si_sm);
- to_clean->io_cleanup(to_clean);
+ if (to_clean->io_cleanup)
+ to_clean->io_cleanup(to_clean);
}
static __exit void cleanup_ipmi_si(void)