diff mbox

[v3,12/12] scsi/ufs: qcom: Don't free resource-managed kmalloc element

Message ID 1477772534-14170-13-git-send-email-vivek.gautam@codeaurora.org (mailing list archive)
State Not Applicable, archived
Delegated to: Andy Gross
Headers show

Commit Message

Vivek Gautam Oct. 29, 2016, 8:22 p.m. UTC
Host is allocated by managed kmalloc (devm_kmalloc). The
memory allocated with this function is automatically
freed on driver detach.
So, no need to make an exclusive free call over it.

Signed-off-by: Vivek Gautam <vivek.gautam@codeaurora.org>
---

New patch added in v3 of this cleanup series.

 drivers/scsi/ufs/ufs-qcom.c | 1 -
 1 file changed, 1 deletion(-)

Comments

subhashj@codeaurora.org Oct. 31, 2016, 9:14 p.m. UTC | #1
On 2016-10-29 13:22, Vivek Gautam wrote:
> Host is allocated by managed kmalloc (devm_kmalloc). The
> memory allocated with this function is automatically
> freed on driver detach.
> So, no need to make an exclusive free call over it.
> 
> Signed-off-by: Vivek Gautam <vivek.gautam@codeaurora.org>
> ---
> 
> New patch added in v3 of this cleanup series.
> 
>  drivers/scsi/ufs/ufs-qcom.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/drivers/scsi/ufs/ufs-qcom.c b/drivers/scsi/ufs/ufs-qcom.c
> index 9590df5..60a38b1 100644
> --- a/drivers/scsi/ufs/ufs-qcom.c
> +++ b/drivers/scsi/ufs/ufs-qcom.c
> @@ -1263,7 +1263,6 @@ static int ufs_qcom_init(struct ufs_hba *hba)
>  out_unregister_bus:
>  	phy_exit(host->generic_phy);
>  out_host_free:
> -	devm_kfree(dev, host);
>  	ufshcd_set_variant(hba, NULL);
>  out:
>  	return err;

LGTM, Reviewed-by: Subhash Jadavani <subhashj@codeaurora.org>
diff mbox

Patch

diff --git a/drivers/scsi/ufs/ufs-qcom.c b/drivers/scsi/ufs/ufs-qcom.c
index 9590df5..60a38b1 100644
--- a/drivers/scsi/ufs/ufs-qcom.c
+++ b/drivers/scsi/ufs/ufs-qcom.c
@@ -1263,7 +1263,6 @@  static int ufs_qcom_init(struct ufs_hba *hba)
 out_unregister_bus:
 	phy_exit(host->generic_phy);
 out_host_free:
-	devm_kfree(dev, host);
 	ufshcd_set_variant(hba, NULL);
 out:
 	return err;