* [PATCH] scsi: ufs: Fix missing error code in ufshcd_hba_init_crypto_capabilities()
@ 2021-05-26 10:29 Jiapeng Chong
0 siblings, 0 replies; only message in thread
From: Jiapeng Chong @ 2021-05-26 10:29 UTC (permalink / raw)
To: alim.akhtar
Cc: avri.altman, jejb, martin.petersen, linux-scsi, linux-kernel,
Jiapeng Chong
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@linux.alibaba.com>
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.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
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2021-05-26 10:29 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-26 10:29 [PATCH] scsi: ufs: Fix missing error code in ufshcd_hba_init_crypto_capabilities() Jiapeng Chong
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).