cmd/gpt: avoid NULL check before free()
PATCH 1/1 cmd/gpt: avoid NULL check before free()
free() checks if its argument is NULL. Do not duplicate this in the calling code.
Signed-off-by Heinrich Schuchardt <[email protected]>
--- cmd/gpt.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
cmd/gpt.c +2 -4
@@ -772,11 +772,9 @@ static int do_rename_gpt_parts(struct blk_desc *dev_desc, char *subcomm, out:del_gpt_info ();#ifdef CONFIG_RANDOM_UUID -if (str_disk_guid) -free (str_disk_guid); +free (str_disk_guid);#endif -if (new_partitions) -free (new_partitions); +free (new_partitions);free (partitions_list);return ret; }
--
2.26.2
PATCH 1/1 cmd/gpt: avoid NULL check before free()
Quoted 4 lines · Heinrich Schuchardt
free()checks if its argument is NULL. Do not duplicate this in the calling code.Signed-off-by Heinrich Schuchardt <[email protected]>
Reviewed-by Tom Rini <[email protected]>
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/20200429/4f464d87/attachment.sig>
PATCH 1/1 cmd/gpt: avoid NULL check before free()
In reply to Heinrich SchuchardtQuoted 5 lines · Heinrich Schuchardt
free()checks if its argument is NULL. Do not duplicate this in the calling code.Signed-off-by Heinrich Schuchardt <[email protected]>Reviewed-by Tom Rini <[email protected]>
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/20200501/0af35b81/attachment.sig>