From 9beb813521d23d7f957fc80c6603810893c8ee53 Mon Sep 17 00:00:00 2001 From: Andrew Mellor Date: Mon, 6 Jun 2022 16:38:46 +1000 Subject: ubinfo: Fix --vol_id return code for absent volume id When using --vol_id and that volume is missing, it should return non-zero like the --name option does. Signed-off-by: Andrew Mellor Signed-off-by: David Oberhollenzer --- ubi-utils/ubinfo.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'ubi-utils') diff --git a/ubi-utils/ubinfo.c b/ubi-utils/ubinfo.c index 29530be..53519cc 100644 --- a/ubi-utils/ubinfo.c +++ b/ubi-utils/ubinfo.c @@ -417,12 +417,9 @@ int main(int argc, char * const argv[]) goto out_libubi; } - if (args.devn != -1 && args.vol_id != -1) { - print_vol_info(libubi, args.devn, args.vol_id); - goto out; - } - - if (args.devn == -1 && args.vol_id == -1) + if (args.devn != -1 && args.vol_id != -1) + err = print_vol_info(libubi, args.devn, args.vol_id); + else if (args.devn == -1 && args.vol_id == -1) err = print_general_info(libubi, args.all); else if (args.devn != -1 && args.vol_id == -1) err = print_dev_info(libubi, args.devn, args.all); -- cgit v1.2.3