Skip to contentSkip to conversation

scsi: ufs: fix error return code of exynos_ufs_get_clk_info()

PATCH New Jia-Ju Bai 1 participant 1 message Mar 5, 2021

Subsystems (2)
lore
Share & tools
lore

Jia-Ju Bai

author
#0 lore raw

PATCH 1/1 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.

---
 drivers/scsi/ufs/ufs-exynos.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/scsi/ufs/ufs-exynos.c +3 -1
index 267943a13a94..d67652e5cc34 100644
@@ -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)) {
Signature · 1 line
2.17.1