Skip to contentSkip to conversation

mmc: fsl_esdhc_spl: remove superfluous free()

PATCH New Heinrich Schuchardt 3 participants 3 messages Dec 27, 2020 – Jan 19, 2021 MMC, SD and SDIO

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mmc: fsl_esdhc_spl: remove superfluous free()

Freeing a buffer before calling hang() is superfluous. Removing the call reduces the SPL size.

---
 drivers/mmc/fsl_esdhc_spl.c | 3 ---
 1 file changed, 3 deletions(-)
drivers/mmc/fsl_esdhc_spl.c +0 -3
index afe55fad9d..bee76572ac 100644
@@ -91,20 +91,17 @@ void __noreturn mmc_boot(void)
 					CONFIG_CFG_DATA_SECTOR, 1, tmp_buf);
 	if (err != 1) {
 		puts("spl: mmc read failed!!\n");
-		free(tmp_buf);
 		hang();
 	}
 
 	val = *(tmp_buf + MBRDBR_BOOT_SIG_55);
 	if (0x55 != val) {
 		puts("spl: mmc signature is not valid!!\n");
-		free(tmp_buf);
 		hang();
 	}
 	val = *(tmp_buf + MBRDBR_BOOT_SIG_AA);
 	if (0xAA != val) {
 		puts("spl: mmc signature is not valid!!\n");
-		free(tmp_buf);
 		hang();
 	}
 

--
2.29.2

#1 lore raw

PATCH 1/1 mmc: fsl_esdhc_spl: remove superfluous free()

Quoted 4 lines · Heinrich Schuchardt

Freeing a buffer before calling hang() is superfluous. Removing the call reduces the SPL size.

Best Regards,
Jaehoon Chung

Quoted 33 lines
---
 drivers/mmc/fsl_esdhc_spl.c | 3 ---
 1 file changed, 3 deletions(-)
drivers/mmc/fsl_esdhc_spl.c +0 -4
index afe55fad9d..bee76572ac 100644
@@ -91,20 +91,17 @@ void __noreturn mmc_boot(void)
 					CONFIG_CFG_DATA_SECTOR, 1, tmp_buf);
 	if (err != 1) {
 		puts("spl: mmc read failed!!\n");
-		free(tmp_buf);
 		hang();
 	}
 
 	val = *(tmp_buf + MBRDBR_BOOT_SIG_55);
 	if (0x55 != val) {
 		puts("spl: mmc signature is not valid!!\n");
-		free(tmp_buf);
 		hang();
 	}
 	val = *(tmp_buf + MBRDBR_BOOT_SIG_AA);
 	if (0xAA != val) {
 		puts("spl: mmc signature is not valid!!\n");
-		free(tmp_buf);
 		hang();
 	}
 
--

2.29.2

#2 lore raw

PATCH 1/1 mmc: fsl_esdhc_spl: remove superfluous free()

In reply to Heinrich Schuchardt
Quoted 5 lines · Heinrich Schuchardt

Freeing a buffer before calling hang() is superfluous. Removing the call reduces the SPL size.

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/a4544e72/attachment.sig>