diff options
-rw-r--r-- | drivers/platform/x86/wmi.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/platform/x86/wmi.c b/drivers/platform/x86/wmi.c index 39ec5b6c2e3a..17df134a6f03 100644 --- a/drivers/platform/x86/wmi.c +++ b/drivers/platform/x86/wmi.c @@ -756,12 +756,10 @@ static __init acpi_status parse_wdg(acpi_handle handle) total = obj->buffer.length / sizeof(struct guid_block); - gblock = kzalloc(obj->buffer.length, GFP_KERNEL); + gblock = kmemdup(obj->buffer.pointer, obj->buffer.length, GFP_KERNEL); if (!gblock) return AE_NO_MEMORY; - memcpy(gblock, obj->buffer.pointer, obj->buffer.length); - for (i = 0; i < total; i++) { /* Some WMI devices, like those for nVidia hooks, have a |