]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
gpt: fix error reporting on partition table write failures
authorRob Herring <robh@kernel.org>
Mon, 26 Jan 2015 15:43:15 +0000 (09:43 -0600)
committerLothar Waßmann <LW@KARO-electronics.de>
Tue, 1 Sep 2015 12:10:30 +0000 (14:10 +0200)
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 <robh@kernel.org>
Reviewed-by: Przemyslaw Marczak <p.marczak@samsung.com>
common/cmd_gpt.c

index 446da2c97009a8ab682ad5726204a7d785dfa846..dad0973f3ca3108985e44ddc7209538d676baed3 100644 (file)
@@ -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;
 }
 
 /**