public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ACPI / memhotplug: Fix a stale pointer in error path
@ 2013-07-10 16:47 Toshi Kani
  2013-07-12  0:24 ` Yasuaki Ishimatsu
  0 siblings, 1 reply; 11+ messages in thread
From: Toshi Kani @ 2013-07-10 16:47 UTC (permalink / raw)
  To: rjw; +Cc: linux-acpi, linux-kernel, Toshi Kani

device->driver_data needs to be cleared when releasing its data,
mem_device, in an error path of acpi_memory_device_add().

Signed-off-by: Toshi Kani <toshi.kani@hp.com>
---
 drivers/acpi/acpi_memhotplug.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/acpi/acpi_memhotplug.c b/drivers/acpi/acpi_memhotplug.c
index c711d11..999adb5 100644
--- a/drivers/acpi/acpi_memhotplug.c
+++ b/drivers/acpi/acpi_memhotplug.c
@@ -323,6 +323,7 @@ static int acpi_memory_device_add(struct acpi_device *device,
 	/* Get the range from the _CRS */
 	result = acpi_memory_get_device_resources(mem_device);
 	if (result) {
+		device->driver_data = NULL;
 		kfree(mem_device);
 		return result;
 	}

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

end of thread, other threads:[~2013-07-15 16:12 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-07-10 16:47 [PATCH] ACPI / memhotplug: Fix a stale pointer in error path Toshi Kani
2013-07-12  0:24 ` Yasuaki Ishimatsu
2013-07-12 14:51   ` Toshi Kani
2013-07-12 20:42     ` Rafael J. Wysocki
2013-07-12 21:01       ` Toshi Kani
2013-07-12 21:13         ` Rafael J. Wysocki
2013-07-12 21:12           ` Toshi Kani
2013-07-12 21:40             ` Rafael J. Wysocki
2013-07-12 22:28               ` Toshi Kani
2013-07-12 23:53                 ` Rafael J. Wysocki
2013-07-15 16:11                   ` Toshi Kani

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox