From: Ye Li Date: Tue, 1 Oct 2024 13:07:56 +0000 (+0800) Subject: mmc: fsl_esdhc_imx: Avoid resource leak X-Git-Url: http://git.dujemihanovic.xyz/%22http:/www.sics.se/static/git-logo.png?a=commitdiff_plain;h=876f6de20aead2de6c55f58b2ecc45375238426c;p=u-boot.git mmc: fsl_esdhc_imx: Avoid resource leak The memory of priv and plat are leaked if max_bus_width is wrong. Signed-off-by: Ye Li Reviewed-by: Peng Fan Signed-off-by: Peng Fan --- diff --git a/drivers/mmc/fsl_esdhc_imx.c b/drivers/mmc/fsl_esdhc_imx.c index a3defe952b..debfc78b7f 100644 --- a/drivers/mmc/fsl_esdhc_imx.c +++ b/drivers/mmc/fsl_esdhc_imx.c @@ -1327,6 +1327,8 @@ int fsl_esdhc_initialize(struct bd_info *bis, struct fsl_esdhc_cfg *cfg) break; default: printf("invalid max bus width %u\n", cfg->max_bus_width); + free(plat); + free(priv); return -EINVAL; }