All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] scsi: ufs: fix error return code of exynos_ufs_get_clk_info()
@ 2021-03-05 10:07 ` Jia-Ju Bai
  0 siblings, 0 replies; 2+ messages in thread
From: Jia-Ju Bai @ 2021-03-05 10:07 UTC (permalink / raw)
  To: alim.akhtar, avri.altman, jejb, martin.petersen, krzk, kwmad.kim,
	beanhuo, weiyongjun1, stanley.chu
  Cc: linux-scsi, linux-arm-kernel, linux-samsung-soc, linux-kernel,
	Jia-Ju Bai

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@tsinghua.edu.cn>
Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.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


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

* [PATCH] scsi: ufs: fix error return code of exynos_ufs_get_clk_info()
@ 2021-03-05 10:07 ` Jia-Ju Bai
  0 siblings, 0 replies; 2+ messages in thread
From: Jia-Ju Bai @ 2021-03-05 10:07 UTC (permalink / raw)
  To: alim.akhtar, avri.altman, jejb, martin.petersen, krzk, kwmad.kim,
	beanhuo, weiyongjun1, stanley.chu
  Cc: linux-scsi, linux-arm-kernel, linux-samsung-soc, linux-kernel,
	Jia-Ju Bai

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@tsinghua.edu.cn>
Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.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


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

end of thread, other threads:[~2021-03-05 10:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-05 10:07 [PATCH] scsi: ufs: fix error return code of exynos_ufs_get_clk_info() Jia-Ju Bai
2021-03-05 10:07 ` Jia-Ju Bai

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.