]> rtime.felk.cvut.cz Git - linux-imx.git/commit
ACPI / PM: Fix possible NULL pointer deref in acpi_pm_device_sleep_state()
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Thu, 27 Jun 2013 12:01:02 +0000 (14:01 +0200)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Fri, 28 Jun 2013 10:55:59 +0000 (12:55 +0200)
commit9b5c7a5a977a330ffaf83c4d383ba247c74c800f
tree43dbd7adfaf40ad4cab7b0d20c2c9bb4c4c01615
parentfa1675b56537651270e79967b7f1ee4202c83bf6
ACPI / PM: Fix possible NULL pointer deref in acpi_pm_device_sleep_state()

After commit fa1675b (ACPI / PM: Rework and clean up
acpi_dev_pm_get_state()) a NULL pointer dereference will take place
if NULL is passed to acpi_pm_device_sleep_state() as the second
argument.

Fix that by avoiding to use the pointer that may be NULL until
it's necessary to store a return value at the location pointed to
by it (if not NULL).

Reported-and-tested-by: Aaron Lu <aaron.lu@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/acpi/device_pm.c