Skip to contentSkip to conversation

ACPI: APEI: EINJ: Clean up on error in einj_probe()

PATCH Applied Dan Carpenter 2 participants 2 messages May 27, 2025

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ACPI: APEI: EINJ: Clean up on error in einj_probe()

Call acpi_put_table() before returning the error code.

Fixes e54b1dc1c4f0 ("ACPI: APEI: EINJ: Remove redundant calls to einj_get_available_error_type()")
---
 drivers/acpi/apei/einj-core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/acpi/apei/einj-core.c +1 -1
index ca3484dac5c4..fea11a35eea3 100644
@@ -766,7 +766,7 @@ static int __init einj_probe(struct faux_device *fdev)
 
 	rc = einj_get_available_error_type(&available_error_type);
 	if (rc)
-		return rc;
+		goto err_put_table;
 
 	rc = -ENOMEM;
 	einj_debug_dir = debugfs_create_dir("einj", apei_get_debugfs_dir());
Signature · 1 line
2.47.2
maintainer Applied
#1 lore raw
Quoted 14 lines · Dan Carpenter

Call acpi_put_table() before returning the error code.

Fixes e54b1dc1c4f0 ("ACPI: APEI: EINJ: Remove redundant calls to einj_get_available_error_type()")
---
 drivers/acpi/apei/einj-core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/acpi/apei/einj-core.c +0 -0
index ca3484dac5c4..fea11a35eea3 100644

drivers/acpi/apei/einj-core.c static int __init einj_probe(struct faux_device *fdev)

Quoted 9 lines
drivers/acpi/apei/einj-core.c +1 -2
@@ -766,7 +766,7 @@ static int __init einj_probe(struct faux_device *fdev)
 
        rc = einj_get_available_error_type(&available_error_type);
        if (rc)
-               return rc;
+               goto err_put_table;
 
        rc = -ENOMEM;
        einj_debug_dir = debugfs_create_dir("einj", apei_get_debugfs_dir());
--

Applied, thanks!