[PATCH] scsi: ufs: Fix missing error code in ufshcd_hba_init_crypto_capabilities()

From: Jiapeng Chong
Date: Wed May 26 2021 - 06:29:28 EST


Eliminate the follow smatch warning:

drivers/scsi/ufs/ufshcd-crypto.c:167
ufshcd_hba_init_crypto_capabilities() warn: missing error code 'err'.

Reported-by: Abaci Robot <abaci@xxxxxxxxxxxxxxxxx>
Signed-off-by: Jiapeng Chong <jiapeng.chong@xxxxxxxxxxxxxxxxx>
---
drivers/scsi/ufs/ufshcd-crypto.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/scsi/ufs/ufshcd-crypto.c b/drivers/scsi/ufs/ufshcd-crypto.c
index d70cdcd..c0163a3 100644
--- a/drivers/scsi/ufs/ufshcd-crypto.c
+++ b/drivers/scsi/ufs/ufshcd-crypto.c
@@ -163,8 +163,10 @@ int ufshcd_hba_init_crypto_capabilities(struct ufs_hba *hba)
* hasn't advertised that crypto is supported.
*/
if (!(hba->capabilities & MASK_CRYPTO_SUPPORT) ||
- !(hba->caps & UFSHCD_CAP_CRYPTO))
+ !(hba->caps & UFSHCD_CAP_CRYPTO)) {
+ err = -EINVAL;
goto out;
+ }

hba->crypto_capabilities.reg_val =
cpu_to_le32(ufshcd_readl(hba, REG_UFS_CCAP));
--
1.8.3.1