1 From d19f503e22316a84c39bc19445e0e4fdd49b3532 Mon Sep 17 00:00:00 2001
2 From: Toshi Kani <toshi.kani@hp.com>
3 Date: Wed, 10 Jul 2013 10:47:13 -0600
4 Subject: ACPI / memhotplug: Fix a stale pointer in error path
6 From: Toshi Kani <toshi.kani@hp.com>
8 commit d19f503e22316a84c39bc19445e0e4fdd49b3532 upstream.
10 device->driver_data needs to be cleared when releasing its data,
11 mem_device, in an error path of acpi_memory_device_add().
13 The function evaluates the _CRS of memory device objects, and fails
14 when it gets an unexpected resource or cannot allocate memory. A
15 kernel crash or data corruption may occur when the kernel accesses
18 Signed-off-by: Toshi Kani <toshi.kani@hp.com>
19 Reviewed-by: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>
20 Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
21 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
24 drivers/acpi/acpi_memhotplug.c | 1 +
25 1 file changed, 1 insertion(+)
27 --- a/drivers/acpi/acpi_memhotplug.c
28 +++ b/drivers/acpi/acpi_memhotplug.c
29 @@ -421,6 +421,7 @@ static int acpi_memory_device_add(struct
30 /* Get the range from the _CRS */
31 result = acpi_memory_get_device_resources(mem_device);
33 + device->driver_data = NULL;