Skip to contentSkip to conversation

i2c_ec: Fix a broken kfree

PATCH New Jean Delvare 1 participant 1 message Aug 1, 2006 ACPI

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 i2c_ec: Fix a broken kfree

Fix an obviously broken kfree() in acpi/i2c_ec device initialization error path.

---
This function would benefit from some improvements (single error path, kzalloc) but let's fix that obvious bug first. This would preferably go to Linus before 2.6.18.

 drivers/acpi/i2c_ec.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/acpi/i2c_ec.c +1 -1
@@ -330,7 +330,7 @@
 	status = acpi_evaluate_integer(ec_hc->handle, "_EC", NULL, &val);
 	if (ACPI_FAILURE(status)) {
 		ACPI_DEBUG_PRINT((ACPI_DB_WARN, "Error obtaining _EC\n"));
-		kfree(ec_hc->smbus);
+		kfree(ec_hc);
 		kfree(smbus);
 		return -EIO;
 	}
Signature · 1 line
Jean Delvare