]> git.karo-electronics.de Git - karo-tx-linux.git/commit
ACPI / LPSS: don't crash if a device has no MMIO resources
authorMika Westerberg <mika.westerberg@linux.intel.com>
Mon, 2 Sep 2013 10:30:25 +0000 (13:30 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 27 Sep 2013 00:18:05 +0000 (17:18 -0700)
commit3fa0d2f124263d0080f266c4c7bfc60153f29b91
treea20d34a1318a9ae2a64fea0c2a477a79d844619a
parentf7e0ca347bcb540e2894833eccc33f9a65f4c822
ACPI / LPSS: don't crash if a device has no MMIO resources

commit af65cfe9aeae03e0682bebdf4db94582d75562dd upstream.

Intel LPSS devices that are enumerated from ACPI have both MMIO and IRQ
resources returned in their _CRS method. However, Apple Macbook Air with
Haswell has LPSS devices enumerated from PCI bus instead and _CRS method
returns only an interrupt number (but the device has _HID set that causes
the scan handler to match it).

The current ACPI / LPSS code sets pdata->dev_desc only when MMIO resource
is found for the device and in case of Macbook Air it is never found. That
leads to a NULL pointer dereference in register_device_clock().

Correct this by always setting the pdata->dev_desc.

Reported-and-tested-by: Imre Kaloz <kaloz@openwrt.org>
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/acpi/acpi_lpss.c