[PATCH] cmd: part: Correct error handling

Sean Anderson sean.anderson at seco.com
Tue Jun 22 16:39:32 CEST 2021



On 6/22/21 5:40 AM, Anders Dellien wrote:
> 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 at arm.com>
> ---
>   cmd/part.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/cmd/part.c b/cmd/part.c
> index 3395c17b89..e0463b5a54 100644
> --- a/cmd/part.c
> +++ b/cmd/part.c
> @@ -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;
>   	}
>   
> 

Reviewed-by: Sean Anderson <sean.anderson at seco.com>


More information about the U-Boot mailing list