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)
committerTejun Heo <tj@kernel.org>
Fri, 14 Mar 2014 15:23:47 +0000 (11:23 -0400)
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>
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;
                }