]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
dm: error handling dev_get_dma_range()
authorHeinrich Schuchardt <xypron.glpk@gmx.de>
Sat, 20 Feb 2021 09:41:22 +0000 (10:41 +0100)
committerSimon Glass <sjg@chromium.org>
Mon, 22 Mar 2021 06:23:26 +0000 (19:23 +1300)
goto after return has not effect. Calling of_node_put() in case of some
errors and not for others is inconsistent.

Fixes: 51bdb50904b ("dm: Introduce xxx_get_dma_range()")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
drivers/core/of_addr.c

index 5bc6ca1de01320d1331f655410328cb9647433a1..b3e384d2ee17cc6f25efa2a3056c9ddeeb0e18cb 100644 (file)
@@ -372,7 +372,7 @@ int of_get_dma_range(const struct device_node *dev, phys_addr_t *cpu,
        bus_node->count_cells(dev, &na, &ns);
        if (!OF_CHECK_COUNTS(na, ns)) {
                printf("Bad cell count for %s\n", of_node_full_name(dev));
-               return -EINVAL;
+               ret = -EINVAL;
                goto out_parent;
        }
 
@@ -380,7 +380,7 @@ int of_get_dma_range(const struct device_node *dev, phys_addr_t *cpu,
        bus_node->count_cells(parent, &pna, &pns);
        if (!OF_CHECK_COUNTS(pna, pns)) {
                printf("Bad cell count for %s\n", of_node_full_name(parent));
-               return -EINVAL;
+               ret = -EINVAL;
                goto out_parent;
        }