scsi: ufs: Remove unnecessary devm_kfree
PATCH v3 1/1 scsi: ufs: Remove unnecessary devm_kfree
From: Bean Huo <[email protected]>
The memory allocated with devm_kzalloc() is freed automatically no need to explicitly call devm_kfree, so delete it and save some instruction cycles.
---
Nothing changed in this patch, just drop one patch from the patchset:
https://patchwork.kernel.org/project/linux-scsi/cover/[email protected]/
--- drivers/scsi/ufs/ufshcd-crypto.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/scsi/ufs/ufshcd-crypto.c +1 -3
@@ -182,7 +182,7 @@ int ufshcd_hba_init_crypto_capabilities(struct ufs_hba *hba) err =blk_ksm_init (&hba->ksm, hba->crypto_capabilities.config_count +1 );if (err) - goto out_free_caps; + goto out; hba->ksm.ksm_ll_ops = ufshcd_ksm_ops;/* UFS only supports 8 bytes for any DUN */
@@ -208,8 +208,6 @@ int ufshcd_hba_init_crypto_capabilities(struct ufs_hba *hba)return 0 ; -out_free_caps: -devm_kfree (hba->dev, hba->crypto_cap_array); out:/* Indicate that init failed by clearing UFSHCD_CAP_CRYPTO */ hba->caps &= ~UFSHCD_CAP_CRYPTO ;
Signature · 1 line
2.17.1
Martin K. Petersen
AppliedBean,
Quoted 3 lines
The memory allocated with
devm_kzalloc()is freed automatically no need to explicitly calldevm_kfree, so delete it and save some instruction cycles.
Applied to 5.12/scsi-staging, thanks!
Signature · 1 line
Martin K. Petersen Oracle Linux Engineering
Martin K. Petersen
AppliedQuoted 3 lines · Bean Huo
The memory allocated with
devm_kzalloc()is freed automatically no need to explicitly calldevm_kfree, so delete it and save some instruction cycles.
Applied to 5.12/scsi-queue, thanks!
[1/1] scsi: ufs: Remove unnecessary devm_kfree
https://git.kernel.org/mkp/scsi/c/b64750a1b65a
Signature · 1 line
Martin K. Petersen Oracle Linux Engineering