Skip to content

Commit 8134233

Browse files
Dan Carpenterhtejun
authored andcommitted
ata: ahci_xgene: dereferencing uninitialized pointer in probe
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>
1 parent 8ba559f commit 8134233

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/ata/ahci_xgene.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -821,9 +821,9 @@ static int xgene_ahci_probe(struct platform_device *pdev)
821821
dev_warn(&pdev->dev, "%s: Error reading device info. Assume version1\n",
822822
__func__);
823823
version = XGENE_AHCI_V1;
824-
}
825-
if (info->valid & ACPI_VALID_CID)
824+
} else if (info->valid & ACPI_VALID_CID) {
826825
version = XGENE_AHCI_V2;
826+
}
827827
}
828828
}
829829
#endif

0 commit comments

Comments
 (0)