[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20210305100759.14500-1-baijiaju1990@gmail.com>
Date: Fri, 5 Mar 2021 02:07:59 -0800
From: Jia-Ju Bai <baijiaju1990@...il.com>
To: alim.akhtar@...sung.com, avri.altman@....com, jejb@...ux.ibm.com,
martin.petersen@...cle.com, krzk@...nel.org, kwmad.kim@...sung.com,
beanhuo@...ron.com, weiyongjun1@...wei.com,
stanley.chu@...iatek.com
Cc: linux-scsi@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
linux-samsung-soc@...r.kernel.org, linux-kernel@...r.kernel.org,
Jia-Ju Bai <baijiaju1990@...il.com>
Subject: [PATCH] scsi: ufs: fix error return code of exynos_ufs_get_clk_info()
When the list of head is empty, no error return code of
exynos_ufs_get_clk_info() is assigned.
To fix this bug, ret is assigned with -ENOENT as error return code.
Reported-by: TOTE Robot <oslab@...nghua.edu.cn>
Signed-off-by: Jia-Ju Bai <baijiaju1990@...il.com>
---
drivers/scsi/ufs/ufs-exynos.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/scsi/ufs/ufs-exynos.c b/drivers/scsi/ufs/ufs-exynos.c
index 267943a13a94..d67652e5cc34 100644
--- a/drivers/scsi/ufs/ufs-exynos.c
+++ b/drivers/scsi/ufs/ufs-exynos.c
@@ -264,8 +264,10 @@ static int exynos_ufs_get_clk_info(struct exynos_ufs *ufs)
u8 div = 0;
int ret = 0;
- if (list_empty(head))
+ if (list_empty(head)) {
+ ret = -ENOENT;
goto out;
+ }
list_for_each_entry(clki, head, list) {
if (!IS_ERR(clki->clk)) {
--
2.17.1
Powered by blists - more mailing lists