From: Heinrich Schuchardt Date: Tue, 28 Apr 2020 19:40:13 +0000 (+0200) Subject: cmd/gpt: avoid NULL check before free() X-Git-Tag: v2020.07-rc2~20^2~10 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=b142d0ac1946701f4d592869c2d81e42afe2e294;p=oweals%2Fu-boot.git 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 Reviewed-by: Tom Rini --- diff --git a/cmd/gpt.c b/cmd/gpt.c index b94f0051cd..b8d11c167d 100644 --- a/cmd/gpt.c +++ b/cmd/gpt.c @@ -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; }