You've already forked linux-rockchip
mirror of
https://github.com/armbian/linux-rockchip.git
synced 2026-01-06 11:08:10 -08:00
UPSTREAM: scsi: ufs: ufs-mediatek: Fix error checking in ufs_mtk_init_va09_pwr_ctrl()
The function regulator_get() returns an error pointer. Use IS_ERR() to validate the return value. Bug: 254441685 Link: https://lore.kernel.org/r/20211222070930.9449-1-linmq006@gmail.com Fixes:cf137b3ea4("scsi: ufs-mediatek: Support VA09 regulator operations") Signed-off-by: Miaoqian Lin <linmq006@gmail.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com> (cherry picked from commit3ba880a12d) Signed-off-by: Lee Jones <joneslee@google.com> Change-Id: Iccf8b09bb8f837139cb4bc7bfc21b29d3423d5b9
This commit is contained in:
@@ -501,7 +501,7 @@ static void ufs_mtk_init_va09_pwr_ctrl(struct ufs_hba *hba)
|
||||
struct ufs_mtk_host *host = ufshcd_get_variant(hba);
|
||||
|
||||
host->reg_va09 = regulator_get(hba->dev, "va09");
|
||||
if (!host->reg_va09)
|
||||
if (IS_ERR(host->reg_va09))
|
||||
dev_info(hba->dev, "failed to get va09");
|
||||
else
|
||||
host->caps |= UFS_MTK_CAP_VA09_PWR_CTRL;
|
||||
|
||||
Reference in New Issue
Block a user