mirror of
https://github.com/torvalds/linux.git
synced 2026-11-07 06:17:02 +01:00
ACPI: sysfs: Finish sysfs init when creating a table file fails
If creating the file for a table fails, acpi_tables_sysfs_init() returns without sending the uevents for the tables directories, and acpi_sysfs_init() returns before creating the hotplug and pm_profile files. Stop creating table files at that point, but finish the rest of the initialization. Skipping only the failed table would give its file name to the next table with the same signature, so reading that file would return the failed table. Signed-off-by: Jamie Nguyen <jamien@nvidia.com> Link: https://patch.msgid.link/20261013193900.1258808-1-jamien@nvidia.com Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
This commit is contained in:
parent
4d23d84ef2
commit
f54ec8af33
|
|
@ -516,7 +516,6 @@ static int acpi_tables_sysfs_init(void)
|
|||
struct acpi_table_header *table_header = NULL;
|
||||
int table_index;
|
||||
acpi_status status;
|
||||
int ret;
|
||||
|
||||
tables_kobj = kobject_create_and_add("tables", acpi_kobj);
|
||||
if (!tables_kobj)
|
||||
|
|
@ -541,13 +540,11 @@ static int acpi_tables_sysfs_init(void)
|
|||
|
||||
table_attr = kzalloc_obj(*table_attr);
|
||||
if (!table_attr)
|
||||
return -ENOMEM;
|
||||
break;
|
||||
|
||||
ret = acpi_table_attr_init(tables_kobj,
|
||||
table_attr, table_header);
|
||||
if (ret) {
|
||||
if (acpi_table_attr_init(tables_kobj, table_attr, table_header)) {
|
||||
kfree(table_attr);
|
||||
return ret;
|
||||
break;
|
||||
}
|
||||
list_add_tail(&table_attr->node, &acpi_table_attr_list);
|
||||
acpi_table_data_init(table_header, table_attr);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user