提交 b64750a1 编写于 作者: B Bean Huo 提交者: Martin K. Petersen

scsi: ufs: Remove unnecessary devm_kfree()

The memory allocated with devm_kzalloc() is freed automatically no need to
explicitly call devm_kfree(). Delete it and save some instruction cycles.

Link: https://lore.kernel.org/r/20210112092128.19295-1-huobean@gmail.comReviewed-by: NEric Biggers <ebiggers@google.com>
Signed-off-by: NBean Huo <beanhuo@micron.com>
Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
上级 af0c94af
...@@ -182,7 +182,7 @@ int ufshcd_hba_init_crypto_capabilities(struct ufs_hba *hba) ...@@ -182,7 +182,7 @@ int ufshcd_hba_init_crypto_capabilities(struct ufs_hba *hba)
err = blk_ksm_init(&hba->ksm, err = blk_ksm_init(&hba->ksm,
hba->crypto_capabilities.config_count + 1); hba->crypto_capabilities.config_count + 1);
if (err) if (err)
goto out_free_caps; goto out;
hba->ksm.ksm_ll_ops = ufshcd_ksm_ops; hba->ksm.ksm_ll_ops = ufshcd_ksm_ops;
/* UFS only supports 8 bytes for any DUN */ /* UFS only supports 8 bytes for any DUN */
...@@ -208,8 +208,6 @@ int ufshcd_hba_init_crypto_capabilities(struct ufs_hba *hba) ...@@ -208,8 +208,6 @@ int ufshcd_hba_init_crypto_capabilities(struct ufs_hba *hba)
return 0; return 0;
out_free_caps:
devm_kfree(hba->dev, hba->crypto_cap_array);
out: out:
/* Indicate that init failed by clearing UFSHCD_CAP_CRYPTO */ /* Indicate that init failed by clearing UFSHCD_CAP_CRYPTO */
hba->caps &= ~UFSHCD_CAP_CRYPTO; hba->caps &= ~UFSHCD_CAP_CRYPTO;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册