From: Arjan van de Ven Date: Mon, 26 Jul 2010 09:04:37 +0000 (+0100) Subject: zero the stack buffer before giving random garbage to the SCU X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=ed6f2b4da32913875355f5c9cbbb38e4168b7801;p=openwrt%2Fstaging%2Fblogic.git zero the stack buffer before giving random garbage to the SCU some messages take 4 bytes, but only fill 3 bytes.... this patch makes sure that whatever we send to the SCU is zeroed first Signed-off-by: Arjan van de Ven Signed-off-by: Alan Cox Signed-off-by: Matthew Garrett --- diff --git a/drivers/platform/x86/intel_scu_ipc.c b/drivers/platform/x86/intel_scu_ipc.c index 1b0d0d54cb0f..b903420fa973 100644 --- a/drivers/platform/x86/intel_scu_ipc.c +++ b/drivers/platform/x86/intel_scu_ipc.c @@ -162,6 +162,8 @@ static int pwr_reg_rdwr(u16 *addr, u8 *data, u32 count, u32 op, u32 id) mutex_lock(&ipclock); + memset(cbuf, 0, sizeof(cbuf)); + if (ipcdev.pdev == NULL) { mutex_unlock(&ipclock); return -ENODEV;