acer-wmi: avoid the warning of 'devices' may be used uninitialized
authorLee, Chun-Yi <joeyli.kernel@gmail.com>
Thu, 3 Jan 2013 02:37:45 +0000 (10:37 +0800)
committerMatthew Garrett <matthew.garrett@nebula.com>
Wed, 27 Feb 2013 13:30:41 +0000 (08:30 -0500)
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 â\80\98WMID_set_capabilitiesâ\80\99:
drivers/platform/x86/acer-wmi.c:1211: warning: â\80\98devicesâ\80\99 may be used
uninitialized in this function

This patch fixes the above warning message.

Cc: Carlos Corbacho <carlos@strangeworlds.co.uk>
Cc: Matthew Garrett <mjg@redhat.com>
Cc: Dmitry Torokhov <dtor@mail.ru>
Cc: Corentin Chary <corentincj@iksaif.net>
Cc: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Lee, Chun-Yi <jlee@suse.com>
Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
drivers/platform/x86/acer-wmi.c

index 563dc3f0e3e7a5cc420d908e86eb8c34b856a6aa..c9076bdaf2c18fc9a34c3d3f906cd333971f57e5 100644 (file)
@@ -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);