summaryrefslogtreecommitdiff
path: root/disk
diff options
context:
space:
mode:
authorSean Anderson <sean.anderson@seco.com>2021-04-12 18:53:06 -0400
committerTom Rini <trini@konsulko.com>2021-04-22 14:09:45 -0400
commitfe5a50910a64d8773fcd1454631d28da72319f28 (patch)
tree4dce2780a6091a0914d5262ca1ef0c277846c6f8 /disk
parent7194527b6a456abaa24198dc4b6c289905c4cffd (diff)
downloadu-boot-fe5a50910a64d8773fcd1454631d28da72319f28.tar.gz
u-boot-fe5a50910a64d8773fcd1454631d28da72319f28.tar.bz2
u-boot-fe5a50910a64d8773fcd1454631d28da72319f28.zip
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 <sean.anderson@seco.com> Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'disk')
-rw-r--r--disk/part.c2
1 files changed, 1 insertions, 1 deletions
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);