From: Rafael J. Wysocki Date: Sun, 16 Apr 2017 23:20:48 +0000 (+0200) Subject: ACPI / scan: Avoid enumerating devices more than once X-Git-Tag: v4.12-rc1~163^2~2^2 X-Git-Url: http://git.samba.org/samba.git/?p=sfrench%2Fcifs-2.6.git;a=commitdiff_plain;h=c381fc3a1bbfc9d780048a0b94afd162e4c3815b ACPI / scan: Avoid enumerating devices more than once acpi_bus_attach() does not check the visited flag for devices that have been enumerated already and some of them may be enumerated for multiple times as a result, because some callers of acpi_bus_scan() don't check the visited flag either. For this reason, modify acpi_bus_attach() to check the visited flag and avoid enumerating devices that have already been enumerated. Signed-off-by: Rafael J. Wysocki Reviewed-by: Mika Westerberg Reviewed-by: Joey Lee --- diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c index f74bc0d28692..c26931067415 100644 --- a/drivers/acpi/scan.c +++ b/drivers/acpi/scan.c @@ -1840,6 +1840,8 @@ static void acpi_bus_attach(struct acpi_device *device) device->flags.power_manageable = 0; device->flags.initialized = true; + } else if (device->flags.visited) { + goto ok; } ret = acpi_scan_attach_handler(device);