"battery" was dereferenced on the error path here. Signed-off-by: Dan Carpenter <error27@xxxxxxxxx> diff --git a/drivers/acpi/battery.c b/drivers/acpi/battery.c index fcc13ac..cfc7a5b 100644 --- a/drivers/acpi/battery.c +++ b/drivers/acpi/battery.c @@ -988,6 +988,7 @@ static int acpi_battery_add(struct acpi_device *device) acpi_battery_remove_fs(device); #endif kfree(battery); + return result; } battery->pm_nb.notifier_call = battery_notify; -- To unsubscribe from this list: send the line "unsubscribe linux-acpi" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html