From: Jeff Garzik Date: Tue, 3 Oct 2006 08:13:52 +0000 (-0700) Subject: [PATCH] ipmi: fix uninitialized data bug X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=397f4ebf4f317b1d5ecd678a8559a5cb5c6975c3;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git [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 Acked-by: Corey Minyard Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- 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);