Skip to contentSkip to conversation

ata: ahci_xgene: potential NULL dereference in probe

PATCH Applied Dan Carpenter 2 participants 2 messages May 15, 2015 – May 18, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.')
drivers/ata/ahci_xgene.c +1 -3
index 2add250..e2c6d9e 100644
@@ -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)) {
Applied
#1 lore raw
Quoted 4 lines · Dan Carpenter

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.')

Applied to libata/for-4.2.

Thanks.

Signature · 1 line
tejun