cmd: part: Correct error handling
authorAnders Dellien <anders.dellien@arm.com>
Tue, 22 Jun 2021 09:40:01 +0000 (10:40 +0100)
committerTom Rini <trini@konsulko.com>
Fri, 23 Jul 2021 11:13:25 +0000 (07:13 -0400)
As 'part_get_info_by_name' now returns more status codes than just
-1 to indicate failure, we need to update the return value check.

Signed-off-by: Anders Dellien <anders.dellien@arm.com>
Reviewed-by: Sean Anderson <sean.anderson@seco.com>
cmd/part.c

index 3395c17..e0463b5 100644 (file)
@@ -140,7 +140,7 @@ static int do_part_info(int argc, char *const argv[], enum cmd_part_info param)
                        return 1;
        } else {
                part = part_get_info_by_name(desc, argv[2], &info);
-               if (part == -1)
+               if (part < 0)
                        return 1;
        }