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 <robh@kernel.org>
Reviewed-by: Przemyslaw Marczak <p.marczak@samsung.com>
diff --git a/common/cmd_gpt.c b/common/cmd_gpt.c
index e38422d..75df3fe 100644
--- a/common/cmd_gpt.c
+++ b/common/cmd_gpt.c
@@ -281,11 +281,11 @@
 	}
 
 	/* 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;
 }
 
 /**