Message ID | 20201227104849.28271-1-xypron.glpk@gmx.de |
---|---|
State | Accepted |
Commit | 80b1ef942d96a6025c96305284f83bc0a8aa194e |
Delegated to: | Tom Rini |
Headers | show |
Series | [1/1] drivers: qe: avoid double free() | expand |
On Sun, Dec 27, 2020 at 11:48:49AM +0100, Heinrich Schuchardt wrote: > Avoid calling free(addr) twice if the device for ucode is not found. > > The problem was indicated by cppcheck. > > Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Applied to u-boot/master, thanks!
diff --git a/drivers/qe/qe.c b/drivers/qe/qe.c index 1a829b5a4c..259e4e3e67 100644 --- a/drivers/qe/qe.c +++ b/drivers/qe/qe.c @@ -288,7 +288,6 @@ void u_qe_init(void) struct mmc *mmc = find_mmc_device(CONFIG_SYS_MMC_ENV_DEV); if (!mmc) { - free(addr); printf("\nMMC cannot find device for ucode\n"); } else { printf("\nMMC read: dev # %u, block # %u, count %u ...\n",
Avoid calling free(addr) twice if the device for ucode is not found. The problem was indicated by cppcheck. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> --- drivers/qe/qe.c | 1 - 1 file changed, 1 deletion(-) -- 2.29.2