Skip to content

Commit

Permalink
ata: ahci_xgene: dereferencing uninitialized pointer in probe
Browse files Browse the repository at this point in the history
If the call to acpi_get_object_info() fails then "info" hasn't been
initialized.  In that situation, we already know that "version" should
be XGENE_AHCI_V1 so we don't actually need to dereference "info".

Fixes: c9802a4 ('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>
  • Loading branch information
Dan Carpenter authored and Tejun Heo committed Mar 11, 2016
1 parent 8ba559f commit 8134233
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/ata/ahci_xgene.c
Original file line number Diff line number Diff line change
Expand Up @@ -821,9 +821,9 @@ static int xgene_ahci_probe(struct platform_device *pdev)
dev_warn(&pdev->dev, "%s: Error reading device info. Assume version1\n",
__func__);
version = XGENE_AHCI_V1;
}
if (info->valid & ACPI_VALID_CID)
} else if (info->valid & ACPI_VALID_CID) {
version = XGENE_AHCI_V2;
}
}
}
#endif
Expand Down

0 comments on commit 8134233

Please sign in to comment.