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.10~242^2~10 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b142d0ac1946701f4d592869c2d81e42afe2e294;p=platform%2Fkernel%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 b94f005..b8d11c1 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; }