[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20231113070951.122821-1-suhui@nfschina.com>
Date: Mon, 13 Nov 2023 15:09:52 +0800
From: Su Hui <suhui@...china.com>
To: yanaijie@...wei.com, jinpu.wang@...ud.ionos.com,
jejb@...ux.ibm.com, martin.petersen@...cle.com, nathan@...nel.org,
ndesaulniers@...gle.com, trix@...hat.com
Cc: Su Hui <suhui@...china.com>, James.Bottomley@...e.de,
aoqingyun@...sh.com, tom_peng@...sh.com, lindar_liu@...sh.com,
linux-scsi@...r.kernel.org, linux-kernel@...r.kernel.org,
llvm@...ts.linux.dev, kernel-janitors@...r.kernel.org
Subject: [PATCH v2] scsi: pm8001: return error code if no attached dev
Clang static analyzer complains that value stored to 'res' is never read.
Return the error code when sas_find_attached_phy_id() failed.
Fixes: dbf9bfe61571 ("[SCSI] pm8001: add SAS/SATA HBA driver")
Signed-off-by: Su Hui <suhui@...china.com>
---
v2:
- correct the problem about Fixes tag.(thanks for Jason's reminder)
drivers/scsi/pm8001/pm8001_sas.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/scsi/pm8001/pm8001_sas.c b/drivers/scsi/pm8001/pm8001_sas.c
index a5a31dfa4512..a1f58bfff5c0 100644
--- a/drivers/scsi/pm8001/pm8001_sas.c
+++ b/drivers/scsi/pm8001/pm8001_sas.c
@@ -662,6 +662,8 @@ static int pm8001_dev_found_notify(struct domain_device *dev)
SAS_ADDR(dev->sas_addr),
SAS_ADDR(parent_dev->sas_addr));
res = phy_id;
+ pm8001_free_dev(pm8001_device);
+ goto found_out;
} else {
pm8001_device->attached_phy = phy_id;
}
--
2.30.2
Powered by blists - more mailing lists