]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
libata: acpi: avoid passing NULL to ACPI evaluation method
authorAaron Lu <aaron.lu@intel.com>
Fri, 14 Mar 2014 05:46:09 +0000 (13:46 +0800)
committerNitin Garg <nitin.garg@freescale.com>
Fri, 16 Jan 2015 03:17:21 +0000 (21:17 -0600)
If ACPI handle for an ATA device is NULL, we shouldn't call
ata_dev_get_GTF as that function will use handle to do some ACPI
evaluation.

Signed-off-by: Aaron Lu <aaron.lu@intel.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
(cherry picked from commit c75da205e02dda3b79ca057e558f97f3d61c855d)

drivers/ata/libata-acpi.c

index 9e69a5308693de59abd5c596244033af43f7b3a8..b4f7cc2522d91a3d843c5c65478549bd0a79c601 100644 (file)
@@ -835,6 +835,7 @@ void ata_acpi_on_resume(struct ata_port *ap)
                ata_for_each_dev(dev, &ap->link, ALL) {
                        ata_acpi_clear_gtf(dev);
                        if (ata_dev_enabled(dev) &&
+                           ata_dev_acpi_handle(dev) &&
                            ata_dev_get_GTF(dev, NULL) >= 0)
                                dev->flags |= ATA_DFLAG_ACPI_PENDING;
                }