aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/platform/x86/wmi.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/platform/x86/wmi.c')
-rw-r--r--drivers/platform/x86/wmi.c28
1 files changed, 15 insertions, 13 deletions
diff --git a/drivers/platform/x86/wmi.c b/drivers/platform/x86/wmi.c
index f06b7c00339d..31c317fb65dc 100644
--- a/drivers/platform/x86/wmi.c
+++ b/drivers/platform/x86/wmi.c
@@ -757,6 +757,15 @@ static int parse_wdg(struct device *wmi_bus_dev, struct acpi_device *device)
757 if (debug_dump_wdg) 757 if (debug_dump_wdg)
758 wmi_dump_wdg(&gblock[i]); 758 wmi_dump_wdg(&gblock[i]);
759 759
760 /*
761 * Some WMI devices, like those for nVidia hooks, have a
762 * duplicate GUID. It's not clear what we should do in this
763 * case yet, so for now, we'll just ignore the duplicate
764 * for device creation.
765 */
766 if (guid_already_parsed(device, gblock[i].guid))
767 continue;
768
760 wblock = kzalloc(sizeof(struct wmi_block), GFP_KERNEL); 769 wblock = kzalloc(sizeof(struct wmi_block), GFP_KERNEL);
761 if (!wblock) 770 if (!wblock)
762 return -ENOMEM; 771 return -ENOMEM;
@@ -764,19 +773,12 @@ static int parse_wdg(struct device *wmi_bus_dev, struct acpi_device *device)
764 wblock->acpi_device = device; 773 wblock->acpi_device = device;
765 wblock->gblock = gblock[i]; 774 wblock->gblock = gblock[i];
766 775
767 /* 776 retval = wmi_create_device(wmi_bus_dev, &gblock[i],
768 Some WMI devices, like those for nVidia hooks, have a 777 wblock, device);
769 duplicate GUID. It's not clear what we should do in this 778 if (retval) {
770 case yet, so for now, we'll just ignore the duplicate 779 put_device(&wblock->dev.dev);
771 for device creation. 780 wmi_free_devices(device);
772 */ 781 goto out_free_pointer;
773 if (!guid_already_parsed(device, gblock[i].guid)) {
774 retval = wmi_create_device(wmi_bus_dev, &gblock[i],
775 wblock, device);
776 if (retval) {
777 wmi_free_devices(device);
778 goto out_free_pointer;
779 }
780 } 782 }
781 783
782 list_add_tail(&wblock->list, &wmi_block_list); 784 list_add_tail(&wblock->list, &wmi_block_list);