diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2015-05-15 12:24:15 +0300 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2015-05-18 16:43:23 -0400 |
commit | 2d32d10103bc94ad2461864664b61ea98c930619 (patch) | |
tree | f91f36d5098222707aac7463310680c45670b3e8 /drivers/ata | |
parent | c9802a4be6611520dd99d91d0d9c4efcaa0fa281 (diff) | |
download | blackbird-op-linux-2d32d10103bc94ad2461864664b61ea98c930619.tar.gz blackbird-op-linux-2d32d10103bc94ad2461864664b61ea98c930619.zip |
ata: ahci_xgene: potential NULL dereference in probe
Smatch complains about this potential NULL dereference of "acpi_id".
Fixes: c9802a4be661 ('ata: ahci_xgene: Add AHCI Support for 2nd HW version of APM X-Gene SoC AHCI SATA Host controller.')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'drivers/ata')
-rw-r--r-- | drivers/ata/ahci_xgene.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/ata/ahci_xgene.c b/drivers/ata/ahci_xgene.c index 2add250d1555..e2c6d9e0c5ac 100644 --- a/drivers/ata/ahci_xgene.c +++ b/drivers/ata/ahci_xgene.c @@ -732,9 +732,7 @@ static int xgene_ahci_probe(struct platform_device *pdev) if (!acpi_id) { dev_warn(&pdev->dev, "No node entry in ACPI table. Assume version1\n"); version = XGENE_AHCI_V1; - } - - if (acpi_id->driver_data) { + } else if (acpi_id->driver_data) { version = (enum xgene_ahci_version) acpi_id->driver_data; status = acpi_get_object_info(ACPI_HANDLE(&pdev->dev), &info); if (ACPI_FAILURE(status)) { |