summaryrefslogtreecommitdiff
path: root/drivers/char
diff options
context:
space:
mode:
authorJeff Garzik <jeff@garzik.org>2006-10-03 01:13:52 -0700
committerLinus Torvalds <torvalds@g5.osdl.org>2006-10-03 08:03:41 -0700
commit397f4ebf4f317b1d5ecd678a8559a5cb5c6975c3 (patch)
treed42ed51b81aaf84016c24af48ad9f4c277da8fac /drivers/char
parentc3b6571384024be31e8b3442c0e7c3b127110d9b (diff)
[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: Jeff Garzik <jeff@garzik.org> Acked-by: Corey Minyard <minyard@acm.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/char')
-rw-r--r--drivers/char/ipmi/ipmi_si_intf.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/char/ipmi/ipmi_si_intf.c b/drivers/char/ipmi/ipmi_si_intf.c
index 908521e36d81..ad9ea06caee0 100644
--- a/drivers/char/ipmi/ipmi_si_intf.c
+++ b/drivers/char/ipmi/ipmi_si_intf.c
@@ -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);