Before actually doing something the user should always confirm the update. Move the question out of the if() block. Signed-off-by: Sascha Hauer <s.hauer@xxxxxxxxxxxxxx> --- arch/arm/mach-omap/am33xx_bbu_nand.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/arm/mach-omap/am33xx_bbu_nand.c b/arch/arm/mach-omap/am33xx_bbu_nand.c index ed55fd1..ee767d3 100644 --- a/arch/arm/mach-omap/am33xx_bbu_nand.c +++ b/arch/arm/mach-omap/am33xx_bbu_nand.c @@ -80,12 +80,12 @@ static int nand_xloadslots_update_handler(struct bbu_handler *handler, nh = container_of(handler, struct nand_bbu_handler, bbu_handler); + ret = bbu_confirm(data); + if (ret != 0) + return ret; + /* check if the devicefile has been overwritten */ if (strcmp(data->devicefile, nh->devicefile[0]) != 0) { - ret = bbu_confirm(data); - if (ret != 0) - return ret; - ret = write_image(data->devicefile, image, size); if (ret != 0) return ret; -- 2.1.0 _______________________________________________ barebox mailing list barebox@xxxxxxxxxxxxxxxxxxx http://lists.infradead.org/mailman/listinfo/barebox