Skip to contentSkip to conversation

ACPI: scan: Introduce acpi_fetch_acpi_dev()

bug report Dan Carpenter 1 participant 1 message Jan 6, 2022 ACPI

lore
Share & tools
lore
#0 lore raw

Hello Rafael J. Wysocki,

The patch e3c963c49887: "ACPI: scan: Introduce acpi_fetch_acpi_dev()" from Dec 3, 2021, leads to the following Smatch static checker warning:

	drivers/acpi/scan.c:2619 acpi_scan_init()
	warn: missing error code here? 'acpi_fetch_acpi_dev()' failed. 'result' = '0'

drivers/acpi/scan.c

    2609         mutex_lock(&acpi_scan_lock);
    2610         /*
    2611          * Enumerate devices in the ACPI namespace.
    2612          */
    2613         result = acpi_bus_scan(ACPI_ROOT_OBJECT);
    2614         if (result)
    2615                 goto out;
    2616 
    2617         acpi_root = acpi_fetch_acpi_dev(ACPI_ROOT_OBJECT);
    2618         if (!acpi_root)

--> 2619 goto out;

set result = ESOMETHING?

    2620 
    2621         /* Fixed feature devices do not exist on HW-reduced platform */
    2622         if (!acpi_gbl_reduced_hardware) {
    2623                 result = acpi_bus_scan_fixed();
    2624                 if (result) {
    2625                         acpi_detach_data(acpi_root->handle,
    2626                                          acpi_scan_drop_device);
    2627                         acpi_device_del(acpi_root);
    2628                         acpi_bus_put_acpi_device(acpi_root);
    2629                         goto out;
    2630                 }
    2631         }
    2632 
    2633         acpi_turn_off_unused_power_resources();
    2634 
    2635         acpi_scan_initialized = true;
    2636 
    2637  out:
    2638         mutex_unlock(&acpi_scan_lock);
    2639         return result;
    2640 }

regards,
dan carpenter