From: Sean Anderson Date: Mon, 12 Apr 2021 22:53:06 +0000 (-0400) Subject: part: Fix bogus return from part_get_info_by_dev_and_name X-Git-Tag: v2025.01-rc5-pxa1908~1906^2~10 X-Git-Url: http://git.dujemihanovic.xyz/html/static/git-logo.png?a=commitdiff_plain;h=fe5a50910a64d8773fcd1454631d28da72319f28;p=u-boot.git part: Fix bogus return from part_get_info_by_dev_and_name blk_get_device_by_str returns the device number on success. So we must check if the return was negative to determine an error. Signed-off-by: Sean Anderson Reviewed-by: Simon Glass --- diff --git a/disk/part.c b/disk/part.c index 80ced2ba88..5e7e59cf25 100644 --- a/disk/part.c +++ b/disk/part.c @@ -725,7 +725,7 @@ static int part_get_info_by_dev_and_name(const char *dev_iface, } ret = blk_get_device_by_str(dev_iface, dev_str, dev_desc); - if (ret) + if (ret < 0) goto cleanup; ret = part_get_info_by_name(*dev_desc, part_str, part_info);