xen/acpi: xen memory hotplug minor updates
authorLiu Jinsong <jinsong.liu@intel.com>
Sat, 16 Feb 2013 08:59:03 +0000 (16:59 +0800)
committerKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Mon, 25 Feb 2013 12:44:21 +0000 (07:44 -0500)
commit484400ffbf2dd33446d71c05b9cddf91932a882e
treebb4d4650a246dadebe0eec93fac459876d67de46
parent77be36de8b07027a70fbc8f02703ccd76cd16d09
xen/acpi: xen memory hotplug minor updates

Dan Carpenter found current xen memory hotplug logic
has potential issue: at func acpi_memory_get_device()
*mem_device = acpi_driver_data(device);
while the device may be NULL and then dereference.

At native side, Rafael recently updated acpi_memory_get_device(),
dropping acpi_bus_add, adding lock, and avoiding above issue.

This patch updates xen memory hotplug logic accordingly, removing
redundant logic, adding lock, and avoiding dereference.

Signed-off-by: Liu Jinsong <jinsong.liu@intel.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
drivers/xen/xen-acpi-memhotplug.c