summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAaron Lu <aaron.lu@intel.com>2014-03-14 09:46:09 +0400
committerTejun Heo <tj@kernel.org>2014-03-14 19:23:47 +0400
commitc75da205e02dda3b79ca057e558f97f3d61c855d (patch)
tree31ea36dbff95ef8926991e637aca9894aa1d2475
parent20e64fa42965a6ec6f0ae4c5d4fda0ccf6c94ff6 (diff)
downloadlinux-c75da205e02dda3b79ca057e558f97f3d61c855d.tar.xz
libata: acpi: avoid passing NULL to ACPI evaluation method
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>
-rw-r--r--drivers/ata/libata-acpi.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/ata/libata-acpi.c b/drivers/ata/libata-acpi.c
index 9e69a5308693..b4f7cc2522d9 100644
--- a/drivers/ata/libata-acpi.c
+++ b/drivers/ata/libata-acpi.c
@@ -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;
}