]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
drivers: qe: avoid double free()
authorAndrew Goodbody <andrew.goodbody@linaro.org>
Fri, 8 Aug 2025 10:29:33 +0000 (11:29 +0100)
committerPeng Fan <peng.fan@nxp.com>
Wed, 27 Aug 2025 07:49:59 +0000 (15:49 +0800)
Avoid calling free(addr) twice if the device for ucode is not found.
This patch repeats a similar fix but that only applied to code without
CONFIG_TFABOOT enabled. This patch applies to the code with
CONFIG_TFABOOT enabled.

This issue was found by Smatch.

Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
drivers/qe/qe.c

index 69b7de084e56f268c1d8b8979974840e72ee0b1c..25880db37cf58391840388ea7d387f150b73c79f 100644 (file)
@@ -255,7 +255,6 @@ void u_qe_init(void)
                struct mmc *mmc = find_mmc_device(CONFIG_ENV_MMC_DEVICE_INDEX);
 
                if (!mmc) {
-                       free(addr);
                        printf("\nMMC cannot find device for ucode\n");
                } else {
                        printf("\nMMC read: dev # %u, block # %u, count %u ...\n",