Skip to contentSkip to conversation

drivers: qe: avoid double free()

PATCH New Heinrich Schuchardt 2 participants 2 messages Dec 27, 2020 – Jan 19, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drivers: qe: avoid double free()

Avoid calling free(addr) twice if the device for ucode is not found.

The problem was indicated by cppcheck.

---
 drivers/qe/qe.c | 1 -
 1 file changed, 1 deletion(-)
drivers/qe/qe.c +0 -1
index 1a829b5a4c..259e4e3e67 100644
@@ -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",

--
2.29.2

#1 lore raw

PATCH 1/1 drivers: qe: avoid double free()

Quoted 5 lines · Heinrich Schuchardt

Avoid calling free(addr) twice if the device for ucode is not found.

The problem was indicated by cppcheck.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20210119/ff2dca4a/attachment.sig>