Skip to contentSkip to conversation

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

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

lore
Share & tools
lore

Jia-Ju Bai

author
#0 lore raw

PATCH 1/1 scsi: ufs: fix error return code of ufshcd_init_clocks()

When the list of head is empty, no error return code of ufshcd_init_clocks() is assigned.
To fix this bug, ret is assigned with -ENOENT as error return code.

---
 drivers/scsi/ufs/ufshcd.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/scsi/ufs/ufshcd.c +3 -1
index 77161750c9fb..6a3e47d8f98f 100644
@@ -8273,8 +8273,10 @@ static int ufshcd_init_clocks(struct ufs_hba *hba)
 	struct device *dev = hba->dev;
 	struct list_head *head = &hba->clk_list_head;
 
-	if (list_empty(head))
+	if (list_empty(head)) {
+		ret = -ENOENT;
 		goto out;
+	}
 
 	list_for_each_entry(clki, head, list) {
 		if (!clki->name)
Signature · 1 line
2.17.1