[<prev] [next>] [day] [month] [year] [list]
Message-Id: <1622024956-39680-1-git-send-email-jiapeng.chong@linux.alibaba.com>
Date: Wed, 26 May 2021 18:29:16 +0800
From: Jiapeng Chong <jiapeng.chong@...ux.alibaba.com>
To: alim.akhtar@...sung.com
Cc: avri.altman@....com, jejb@...ux.ibm.com,
martin.petersen@...cle.com, linux-scsi@...r.kernel.org,
linux-kernel@...r.kernel.org,
Jiapeng Chong <jiapeng.chong@...ux.alibaba.com>
Subject: [PATCH] scsi: ufs: Fix missing error code in ufshcd_hba_init_crypto_capabilities()
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@...ux.alibaba.com>
Signed-off-by: Jiapeng Chong <jiapeng.chong@...ux.alibaba.com>
---
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
Powered by blists - more mailing lists