From: Bean Huo Date: Tue, 12 Jan 2021 09:21:28 +0000 (+0100) Subject: scsi: ufs: Remove unnecessary devm_kfree() X-Git-Tag: accepted/tizen/unified/20230118.172025~7706^2~164 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b64750a1b65ac7a7dfaf62f75c2e211a51a7914a;p=platform%2Fkernel%2Flinux-rpi.git 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.com Reviewed-by: Eric Biggers Signed-off-by: Bean Huo Signed-off-by: Martin K. Petersen --- diff --git a/drivers/scsi/ufs/ufshcd-crypto.c b/drivers/scsi/ufs/ufshcd-crypto.c index 07310b1..ec80ec8 100644 --- a/drivers/scsi/ufs/ufshcd-crypto.c +++ b/drivers/scsi/ufs/ufshcd-crypto.c @@ -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;