All of lore.kernel.org
 help / color / mirror / Atom feed
From: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
To: Bhaumik Bhatt <bbhatt@codeaurora.org>
Cc: jhugo@codeaurora.org, linux-arm-msm@vger.kernel.org,
	linux-kernel@vger.kernel.org, hemantk@codeaurora.org,
	ath11k@lists.infradead.org, kvalo@codeaurora.org
Subject: Re: [PATCH] ath11k: use MHI provided APIs to allocate and free MHI controller
Date: Tue, 17 Nov 2020 09:06:48 +0530	[thread overview]
Message-ID: <20201117033648.GA7787@work> (raw)
In-Reply-To: <1605571300-4438-1-git-send-email-bbhatt@codeaurora.org>

+ath11k list

On Mon, Nov 16, 2020 at 04:01:40PM -0800, Bhaumik Bhatt wrote:
> Use MHI provided APIs to allocate and free MHI controller to
> improve MHI host driver handling. This also fixes a memory leak
> as the MHI controller was allocated but never freed.
> 
> Signed-off-by: Bhaumik Bhatt <bbhatt@codeaurora.org>

Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>

Thanks,
Mani

> ---
>  drivers/net/wireless/ath/ath11k/mhi.c | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/net/wireless/ath/ath11k/mhi.c b/drivers/net/wireless/ath/ath11k/mhi.c
> index aded9a7..1c9d9dc 100644
> --- a/drivers/net/wireless/ath/ath11k/mhi.c
> +++ b/drivers/net/wireless/ath/ath11k/mhi.c
> @@ -218,7 +218,7 @@ int ath11k_mhi_register(struct ath11k_pci *ab_pci)
>  	struct mhi_controller *mhi_ctrl;
>  	int ret;
>  
> -	mhi_ctrl = kzalloc(sizeof(*mhi_ctrl), GFP_KERNEL);
> +	mhi_ctrl = mhi_alloc_controller();
>  	if (!mhi_ctrl)
>  		return -ENOMEM;
>  
> @@ -234,7 +234,7 @@ int ath11k_mhi_register(struct ath11k_pci *ab_pci)
>  	ret = ath11k_mhi_get_msi(ab_pci);
>  	if (ret) {
>  		ath11k_err(ab, "failed to get msi for mhi\n");
> -		kfree(mhi_ctrl);
> +		mhi_free_controller(mhi_ctrl);
>  		return ret;
>  	}
>  
> @@ -252,7 +252,7 @@ int ath11k_mhi_register(struct ath11k_pci *ab_pci)
>  	ret = mhi_register_controller(mhi_ctrl, &ath11k_mhi_config);
>  	if (ret) {
>  		ath11k_err(ab, "failed to register to mhi bus, err = %d\n", ret);
> -		kfree(mhi_ctrl);
> +		mhi_free_controller(mhi_ctrl);
>  		return ret;
>  	}
>  
> @@ -265,6 +265,7 @@ void ath11k_mhi_unregister(struct ath11k_pci *ab_pci)
>  
>  	mhi_unregister_controller(mhi_ctrl);
>  	kfree(mhi_ctrl->irq);
> +	mhi_free_controller(mhi_ctrl);
>  }
>  
>  static char *ath11k_mhi_state_to_str(enum ath11k_mhi_state mhi_state)
> -- 
> The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
> a Linux Foundation Collaborative Project
> 

-- 
ath11k mailing list
ath11k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath11k

WARNING: multiple messages have this Message-ID (diff)
From: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
To: Bhaumik Bhatt <bbhatt@codeaurora.org>
Cc: kvalo@codeaurora.org, linux-arm-msm@vger.kernel.org,
	hemantk@codeaurora.org, jhugo@codeaurora.org,
	linux-kernel@vger.kernel.org, ath11k@lists.infradead.org
Subject: Re: [PATCH] ath11k: use MHI provided APIs to allocate and free MHI controller
Date: Tue, 17 Nov 2020 09:06:48 +0530	[thread overview]
Message-ID: <20201117033648.GA7787@work> (raw)
In-Reply-To: <1605571300-4438-1-git-send-email-bbhatt@codeaurora.org>

+ath11k list

On Mon, Nov 16, 2020 at 04:01:40PM -0800, Bhaumik Bhatt wrote:
> Use MHI provided APIs to allocate and free MHI controller to
> improve MHI host driver handling. This also fixes a memory leak
> as the MHI controller was allocated but never freed.
> 
> Signed-off-by: Bhaumik Bhatt <bbhatt@codeaurora.org>

Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>

Thanks,
Mani

> ---
>  drivers/net/wireless/ath/ath11k/mhi.c | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/net/wireless/ath/ath11k/mhi.c b/drivers/net/wireless/ath/ath11k/mhi.c
> index aded9a7..1c9d9dc 100644
> --- a/drivers/net/wireless/ath/ath11k/mhi.c
> +++ b/drivers/net/wireless/ath/ath11k/mhi.c
> @@ -218,7 +218,7 @@ int ath11k_mhi_register(struct ath11k_pci *ab_pci)
>  	struct mhi_controller *mhi_ctrl;
>  	int ret;
>  
> -	mhi_ctrl = kzalloc(sizeof(*mhi_ctrl), GFP_KERNEL);
> +	mhi_ctrl = mhi_alloc_controller();
>  	if (!mhi_ctrl)
>  		return -ENOMEM;
>  
> @@ -234,7 +234,7 @@ int ath11k_mhi_register(struct ath11k_pci *ab_pci)
>  	ret = ath11k_mhi_get_msi(ab_pci);
>  	if (ret) {
>  		ath11k_err(ab, "failed to get msi for mhi\n");
> -		kfree(mhi_ctrl);
> +		mhi_free_controller(mhi_ctrl);
>  		return ret;
>  	}
>  
> @@ -252,7 +252,7 @@ int ath11k_mhi_register(struct ath11k_pci *ab_pci)
>  	ret = mhi_register_controller(mhi_ctrl, &ath11k_mhi_config);
>  	if (ret) {
>  		ath11k_err(ab, "failed to register to mhi bus, err = %d\n", ret);
> -		kfree(mhi_ctrl);
> +		mhi_free_controller(mhi_ctrl);
>  		return ret;
>  	}
>  
> @@ -265,6 +265,7 @@ void ath11k_mhi_unregister(struct ath11k_pci *ab_pci)
>  
>  	mhi_unregister_controller(mhi_ctrl);
>  	kfree(mhi_ctrl->irq);
> +	mhi_free_controller(mhi_ctrl);
>  }
>  
>  static char *ath11k_mhi_state_to_str(enum ath11k_mhi_state mhi_state)
> -- 
> The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
> a Linux Foundation Collaborative Project
> 

  reply	other threads:[~2020-11-17  3:36 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-17  0:01 [PATCH] ath11k: use MHI provided APIs to allocate and free MHI controller Bhaumik Bhatt
2020-11-17  3:36 ` Manivannan Sadhasivam [this message]
2020-11-17  3:36   ` Manivannan Sadhasivam
2020-11-17  7:14 ` Kalle Valo
2020-11-17  7:14   ` Kalle Valo
2020-11-17 17:17   ` Bhaumik Bhatt
2020-11-17 17:17     ` Bhaumik Bhatt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201117033648.GA7787@work \
    --to=manivannan.sadhasivam@linaro.org \
    --cc=ath11k@lists.infradead.org \
    --cc=bbhatt@codeaurora.org \
    --cc=hemantk@codeaurora.org \
    --cc=jhugo@codeaurora.org \
    --cc=kvalo@codeaurora.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.