Commit 2d32d101 authored by Dan Carpenter's avatar Dan Carpenter Committed by Tejun Heo

ata: ahci_xgene: potential NULL dereference in probe

Smatch complains about this potential NULL dereference of "acpi_id".

Fixes: c9802a4b ('ata: ahci_xgene: Add AHCI Support for 2nd HW version of APM X-Gene SoC AHCI SATA Host controller.')
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarTejun Heo <tj@kernel.org>
parent c9802a4b
...@@ -732,9 +732,7 @@ static int xgene_ahci_probe(struct platform_device *pdev) ...@@ -732,9 +732,7 @@ static int xgene_ahci_probe(struct platform_device *pdev)
if (!acpi_id) { if (!acpi_id) {
dev_warn(&pdev->dev, "No node entry in ACPI table. Assume version1\n"); dev_warn(&pdev->dev, "No node entry in ACPI table. Assume version1\n");
version = XGENE_AHCI_V1; version = XGENE_AHCI_V1;
} } else if (acpi_id->driver_data) {
if (acpi_id->driver_data) {
version = (enum xgene_ahci_version) acpi_id->driver_data; version = (enum xgene_ahci_version) acpi_id->driver_data;
status = acpi_get_object_info(ACPI_HANDLE(&pdev->dev), &info); status = acpi_get_object_info(ACPI_HANDLE(&pdev->dev), &info);
if (ACPI_FAILURE(status)) { if (ACPI_FAILURE(status)) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment