dm: error handling dev_get_dma_range()

goto after return has not effect. Calling of_node_put() in case of some
errors and not for others is inconsistent.

Fixes: 51bdb50904 ("dm: Introduce xxx_get_dma_range()")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
Heinrich Schuchardt authored and Simon Glass committed 2021-03-22 19:23:26 +13:00
1 parent 4a2a78ca5c
commit c803838fa8
1 file changed
+2 -2
+2 -2
View 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;
}