From: Lee, Chun-Yi Date: Thu, 3 Jan 2013 02:37:45 +0000 (+0800) Subject: acer-wmi: avoid the warning of 'devices' may be used uninitialized X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=f24c96eae58aeea4c36fb064cf3ee9734933f8fc;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git acer-wmi: avoid the warning of 'devices' may be used uninitialized Fengguang Wu run kernel build test to platform-drivers-x86/linux-next git tree on x86_64 architecture and found a warning that was introduced by 727651bf738b6b917335025d09323d0962eda114 commit: drivers/platform/x86/acer-wmi.c: In function ‘WMID_set_capabilities’: drivers/platform/x86/acer-wmi.c:1211: warning: ‘devices’ may be used uninitialized in this function This patch fixes the above warning message. Cc: Carlos Corbacho Cc: Matthew Garrett Cc: Dmitry Torokhov Cc: Corentin Chary Cc: Fengguang Wu Signed-off-by: Lee, Chun-Yi Signed-off-by: Matthew Garrett --- diff --git a/drivers/platform/x86/acer-wmi.c b/drivers/platform/x86/acer-wmi.c index 563dc3f0e3e7..c9076bdaf2c1 100644 --- a/drivers/platform/x86/acer-wmi.c +++ b/drivers/platform/x86/acer-wmi.c @@ -1222,6 +1222,9 @@ static acpi_status WMID_set_capabilities(void) devices = *((u32 *) obj->buffer.pointer); } else if (obj->type == ACPI_TYPE_INTEGER) { devices = (u32) obj->integer.value; + } else { + kfree(out.pointer); + return AE_ERROR; } } else { kfree(out.pointer);