mmc: mediatek: free the ext_csd when mmc_get_ext_csd success
Subsystems (4)
PATCH RESEND 1/1 mmc: mediatek: free the ext_csd when mmc_get_ext_csd success
If mmc_get_ext_csd success, the ext_csd are not freed. Add the missing kfree() calls.
Signed-off-by Wenbin Mei <[email protected]>
Fixes c4ac38c6539b ("mmc: mtk-sd: Add HS400 online tuning support")
--- drivers/mmc/host/mtk-sd.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/mmc/host/mtk-sd.c +3 -1
@@ -2291,8 +2291,10 @@ static int msdc_execute_hs400_tuning(struct mmc_host *mmc, struct mmc_card *cardsdr_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;
Signature · 1 line
2.25.1
Quoted 7 lines · Wenbin Mei
If
mmc_get_ext_csdsuccess, theext_csdare not freed. Add the missingkfree()calls.Signed-off-by Wenbin Mei <[email protected]>Fixes c4ac38c6539b ("mmc: mtk-sd: Add HS400 online tuning support")
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
Quoted 23 lines
--- drivers/mmc/host/mtk-sd.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)drivers/mmc/host/mtk-sd.c +3
-2@@ -2291,8 +2291,10 @@ static int msdc_execute_hs400_tuning(struct mmc_host *mmc, struct mmc_card *cardsdr_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