From: Rob Herring Date: Mon, 26 Jan 2015 15:43:15 +0000 (-0600) Subject: gpt: fix error reporting on partition table write failures X-Git-Tag: KARO-TX6-2015-09-18~3437 X-Git-Url: https://git.kernelconcepts.de/?a=commitdiff_plain;h=568c9a67bba98dcbde7c5575c7578a3c32a51076;p=karo-tx-uboot.git gpt: fix error reporting on partition table write failures The gpt command always reports success even if writing the partition table failed. Propagate the return value of gpt_restore so we get proper status reported. Signed-off-by: Rob Herring Reviewed-by: Przemyslaw Marczak --- diff --git a/common/cmd_gpt.c b/common/cmd_gpt.c index 446da2c970..dad0973f3c 100644 --- a/common/cmd_gpt.c +++ b/common/cmd_gpt.c @@ -293,11 +293,11 @@ static int gpt_default(block_dev_desc_t *blk_dev_desc, const char *str_part) } /* save partitions layout to disk */ - gpt_restore(blk_dev_desc, str_disk_guid, partitions, part_count); + ret = gpt_restore(blk_dev_desc, str_disk_guid, partitions, part_count); free(str_disk_guid); free(partitions); - return 0; + return ret; } /**