linux-acpi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] ACPI: use after free in acpi_battery_add()
@ 2011-03-29  3:12 Dan Carpenter
  2011-06-16 19:18 ` Dan Carpenter
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2011-03-29  3:12 UTC (permalink / raw)
  To: Len Brown; +Cc: linux-acpi, kernel-janitors

"battery" was dereferenced on the error path here.

Signed-off-by: Dan Carpenter <error27@gmail.com>

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;

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-06-16 19:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-29  3:12 [patch] ACPI: use after free in acpi_battery_add() Dan Carpenter
2011-06-16 19:18 ` Dan Carpenter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).