linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] ata: ahci_xgene: potential NULL dereference in probe
@ 2015-05-15  9:24 Dan Carpenter
  2015-05-18 20:44 ` Tejun Heo
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2015-05-15  9:24 UTC (permalink / raw)
  To: Tejun Heo, Suman Tripathi; +Cc: linux-ide, kernel-janitors

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>

diff --git a/drivers/ata/ahci_xgene.c b/drivers/ata/ahci_xgene.c
index 2add250..e2c6d9e 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)) {

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [patch] ata: ahci_xgene: potential NULL dereference in probe
  2015-05-15  9:24 [patch] ata: ahci_xgene: potential NULL dereference in probe Dan Carpenter
@ 2015-05-18 20:44 ` Tejun Heo
  0 siblings, 0 replies; 2+ messages in thread
From: Tejun Heo @ 2015-05-18 20:44 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: Suman Tripathi, linux-ide, kernel-janitors

On Fri, May 15, 2015 at 12:24:15PM +0300, Dan Carpenter wrote:
> 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>

Applied to libata/for-4.2.

Thanks.

-- 
tejun

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-05-18 20:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-15  9:24 [patch] ata: ahci_xgene: potential NULL dereference in probe Dan Carpenter
2015-05-18 20:44 ` Tejun Heo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).