aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/platform/x86/wmi.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2010-08-04 13:44:06 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2010-08-04 13:44:06 -0400
commitc145307a110c14d09d5d92ff3c49dc0940e44b80 (patch)
treecba923818dea8857022de06ffd94ec6b2967aa1f /drivers/platform/x86/wmi.c
parent5e83f6fbdb020b70c0e413312801424d13c58d68 (diff)
parent1a14703d6b20010401ca273ac1f07bff7992aa2c (diff)
Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mjg59/platform-drivers-x86
* 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mjg59/platform-drivers-x86: (88 commits) ips driver: make it less chatty intel_scu_ipc: fix size field for intel_scu_ipc_command intel_scu_ipc: return -EIO for error condition in busy_loop intel_scu_ipc: fix data packing of PMIC command on Moorestown Clean up command packing on MRST. zero the stack buffer before giving random garbage to the SCU Fix stack buffer size for IPC writev messages intel_scu_ipc: Use the new cpu identification function intel_scu_ipc: tidy up unused bits Remove indirect read write api support. intel_scu_ipc: Support Medfield processors intel_scu_ipc: detect CPU type automatically x86 plat: limit x86 platform driver menu to X86 acpi ec_sys: Be more cautious about ec write access acpi ec: Fix possible double io port registration hp-wmi: acpi_drivers.h is already included through acpi.h two lines below hp-wmi: Fix mixing up of and/or directive dell-laptop: make dell_laptop_i8042_filter() static asus-laptop: fix asus_input_init error path msi-wmi: make needlessly global symbols static ...
Diffstat (limited to 'drivers/platform/x86/wmi.c')
-rw-r--r--drivers/platform/x86/wmi.c28
1 files changed, 20 insertions, 8 deletions
diff --git a/drivers/platform/x86/wmi.c b/drivers/platform/x86/wmi.c
index e4eaa14ed987..b2978a04317f 100644
--- a/drivers/platform/x86/wmi.c
+++ b/drivers/platform/x86/wmi.c
@@ -518,8 +518,13 @@ static void wmi_notify_debug(u32 value, void *context)
518{ 518{
519 struct acpi_buffer response = { ACPI_ALLOCATE_BUFFER, NULL }; 519 struct acpi_buffer response = { ACPI_ALLOCATE_BUFFER, NULL };
520 union acpi_object *obj; 520 union acpi_object *obj;
521 acpi_status status;
521 522
522 wmi_get_event_data(value, &response); 523 status = wmi_get_event_data(value, &response);
524 if (status != AE_OK) {
525 printk(KERN_INFO "wmi: bad event status 0x%x\n", status);
526 return;
527 }
523 528
524 obj = (union acpi_object *)response.pointer; 529 obj = (union acpi_object *)response.pointer;
525 530
@@ -543,6 +548,7 @@ static void wmi_notify_debug(u32 value, void *context)
543 default: 548 default:
544 printk("object type 0x%X\n", obj->type); 549 printk("object type 0x%X\n", obj->type);
545 } 550 }
551 kfree(obj);
546} 552}
547 553
548/** 554/**
@@ -804,7 +810,7 @@ static bool guid_already_parsed(const char *guid_string)
804/* 810/*
805 * Parse the _WDG method for the GUID data blocks 811 * Parse the _WDG method for the GUID data blocks
806 */ 812 */
807static __init acpi_status parse_wdg(acpi_handle handle) 813static acpi_status parse_wdg(acpi_handle handle)
808{ 814{
809 struct acpi_buffer out = {ACPI_ALLOCATE_BUFFER, NULL}; 815 struct acpi_buffer out = {ACPI_ALLOCATE_BUFFER, NULL};
810 union acpi_object *obj; 816 union acpi_object *obj;
@@ -827,8 +833,10 @@ static __init acpi_status parse_wdg(acpi_handle handle)
827 total = obj->buffer.length / sizeof(struct guid_block); 833 total = obj->buffer.length / sizeof(struct guid_block);
828 834
829 gblock = kmemdup(obj->buffer.pointer, obj->buffer.length, GFP_KERNEL); 835 gblock = kmemdup(obj->buffer.pointer, obj->buffer.length, GFP_KERNEL);
830 if (!gblock) 836 if (!gblock) {
831 return AE_NO_MEMORY; 837 status = AE_NO_MEMORY;
838 goto out_free_pointer;
839 }
832 840
833 for (i = 0; i < total; i++) { 841 for (i = 0; i < total; i++) {
834 /* 842 /*
@@ -848,8 +856,10 @@ static __init acpi_status parse_wdg(acpi_handle handle)
848 wmi_dump_wdg(&gblock[i]); 856 wmi_dump_wdg(&gblock[i]);
849 857
850 wblock = kzalloc(sizeof(struct wmi_block), GFP_KERNEL); 858 wblock = kzalloc(sizeof(struct wmi_block), GFP_KERNEL);
851 if (!wblock) 859 if (!wblock) {
852 return AE_NO_MEMORY; 860 status = AE_NO_MEMORY;
861 goto out_free_gblock;
862 }
853 863
854 wblock->gblock = gblock[i]; 864 wblock->gblock = gblock[i];
855 wblock->handle = handle; 865 wblock->handle = handle;
@@ -860,8 +870,10 @@ static __init acpi_status parse_wdg(acpi_handle handle)
860 list_add_tail(&wblock->list, &wmi_blocks.list); 870 list_add_tail(&wblock->list, &wmi_blocks.list);
861 } 871 }
862 872
863 kfree(out.pointer); 873out_free_gblock:
864 kfree(gblock); 874 kfree(gblock);
875out_free_pointer:
876 kfree(out.pointer);
865 877
866 return status; 878 return status;
867} 879}
@@ -947,7 +959,7 @@ static int acpi_wmi_remove(struct acpi_device *device, int type)
947 return 0; 959 return 0;
948} 960}
949 961
950static int __init acpi_wmi_add(struct acpi_device *device) 962static int acpi_wmi_add(struct acpi_device *device)
951{ 963{
952 acpi_status status; 964 acpi_status status;
953 int result = 0; 965 int result = 0;