]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
disk: get_device_and_partition() return value fixes
authorStephen Warren <swarren@nvidia.com>
Mon, 8 Oct 2012 07:45:54 +0000 (07:45 +0000)
committerTom Rini <trini@ti.com>
Wed, 17 Oct 2012 14:59:09 +0000 (07:59 -0700)
When no valid partitions are found, guarantee that we return -1. This
most likely already happens, since the most recent get_partition_info()
will have returned an error. However, it's best to be explicit.

Remove an unnecessary assignment of ret=0 in the success case; this value
is over-written with the processed partition ID later.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
disk/part.c

index 30229692fb84c22bdbe0801721a76ccc48a9bf22..a0c77ddc9d52161270ff437a6ffafd22f1c445d2 100644 (file)
@@ -624,9 +624,9 @@ int get_device_and_partition(const char *ifname, const char *dev_part_str,
                         */
                        if (p == MAX_SEARCH_PARTITIONS + 1)
                                *info = tmpinfo;
-                       ret = 0;
                } else {
                        printf("** No valid partitions found **\n");
+                       ret = -1;
                        goto cleanup;
                }
        }