* [RESEND PATCH v1] mmc: mediatek: free the ext_csd when mmc_get_ext_csd success
@ 2021-12-07 7:50 Wenbin Mei
2021-12-09 10:05 ` Ulf Hansson
0 siblings, 1 reply; 2+ messages in thread
From: Wenbin Mei @ 2021-12-07 7:50 UTC (permalink / raw)
To: Ulf Hansson
Cc: Matthias Brugger, Chaotian Jing, Wenbin Mei, linux-mmc,
linux-kernel, linux-arm-kernel, linux-mediatek, srv_heupstream,
stable
If mmc_get_ext_csd success, the ext_csd are not freed.
Add the missing kfree() calls.
Signed-off-by: Wenbin Mei <wenbin.mei@mediatek.com>
Fixes: c4ac38c6539b ("mmc: mtk-sd: Add HS400 online tuning support")
Cc: stable@vger.kernel.org
---
drivers/mmc/host/mtk-sd.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/mmc/host/mtk-sd.c b/drivers/mmc/host/mtk-sd.c
index 943940b44e83..632775217d35 100644
--- a/drivers/mmc/host/mtk-sd.c
+++ b/drivers/mmc/host/mtk-sd.c
@@ -2291,8 +2291,10 @@ static int msdc_execute_hs400_tuning(struct mmc_host *mmc, struct mmc_card *card
sdr_set_field(host->base + PAD_DS_TUNE,
PAD_DS_TUNE_DLY1, i);
ret = mmc_get_ext_csd(card, &ext_csd);
- if (!ret)
+ if (!ret) {
result_dly1 |= (1 << i);
+ kfree(ext_csd);
+ }
}
host->hs400_tuning = false;
--
2.25.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [RESEND PATCH v1] mmc: mediatek: free the ext_csd when mmc_get_ext_csd success
2021-12-07 7:50 [RESEND PATCH v1] mmc: mediatek: free the ext_csd when mmc_get_ext_csd success Wenbin Mei
@ 2021-12-09 10:05 ` Ulf Hansson
0 siblings, 0 replies; 2+ messages in thread
From: Ulf Hansson @ 2021-12-09 10:05 UTC (permalink / raw)
To: Wenbin Mei
Cc: Matthias Brugger, Chaotian Jing, linux-mmc, linux-kernel,
linux-arm-kernel, linux-mediatek, srv_heupstream, stable
On Tue, 7 Dec 2021 at 08:50, Wenbin Mei <wenbin.mei@mediatek.com> wrote:
>
> If mmc_get_ext_csd success, the ext_csd are not freed.
> Add the missing kfree() calls.
>
> Signed-off-by: Wenbin Mei <wenbin.mei@mediatek.com>
> Fixes: c4ac38c6539b ("mmc: mtk-sd: Add HS400 online tuning support")
> Cc: stable@vger.kernel.org
We don't need the stable tag in this case, as commit c4ac38c6539b was
introduced in v5.16-rc1. In any case, thanks for adding the fixes tag,
it certainly helps!
Applied for fixes, thanks!
Kind regards
Uffe
> ---
> drivers/mmc/host/mtk-sd.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/mmc/host/mtk-sd.c b/drivers/mmc/host/mtk-sd.c
> index 943940b44e83..632775217d35 100644
> --- a/drivers/mmc/host/mtk-sd.c
> +++ b/drivers/mmc/host/mtk-sd.c
> @@ -2291,8 +2291,10 @@ static int msdc_execute_hs400_tuning(struct mmc_host *mmc, struct mmc_card *card
> sdr_set_field(host->base + PAD_DS_TUNE,
> PAD_DS_TUNE_DLY1, i);
> ret = mmc_get_ext_csd(card, &ext_csd);
> - if (!ret)
> + if (!ret) {
> result_dly1 |= (1 << i);
> + kfree(ext_csd);
> + }
> }
> host->hs400_tuning = false;
>
> --
> 2.25.1
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-12-09 10:06 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-07 7:50 [RESEND PATCH v1] mmc: mediatek: free the ext_csd when mmc_get_ext_csd success Wenbin Mei
2021-12-09 10:05 ` Ulf Hansson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).