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-Tag: v3.8.3~21 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=d79ba09797140b624e8b0e71e67c5afc6bca797d;p=users%2Fjedix%2Flinux-maple.git acer-wmi: avoid the warning of 'devices' may be used uninitialized commit f24c96eae58aeea4c36fb064cf3ee9734933f8fc upstream. 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. Signed-off-by: Lee, Chun-Yi Cc: Carlos Corbacho Cc: Matthew Garrett Cc: Dmitry Torokhov Cc: Corentin Chary Cc: Fengguang Wu Signed-off-by: Matthew Garrett Signed-off-by: Paul Bolle Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/platform/x86/acer-wmi.c b/drivers/platform/x86/acer-wmi.c index afed7018a2b5..684ce75c28e2 100644 --- a/drivers/platform/x86/acer-wmi.c +++ b/drivers/platform/x86/acer-wmi.c @@ -1204,6 +1204,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);