Message ID | 20210220094122.2981-1-xypron.glpk@gmx.de |
---|---|
State | Accepted |
Commit | c803838fa85d681a0ea60409fc81f596a2e9c07c |
Delegated to: | Simon Glass |
Headers | show |
Series | [1/1] dm: error handling dev_get_dma_range() | expand |
On Sat, 20 Feb 2021 at 02:41, Heinrich Schuchardt <xypron.glpk@gmx.de> wrote: > > 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> > --- > drivers/core/of_addr.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) Reviewed-by: Simon Glass <sjg@chromium.org>
On Sat, 20 Feb 2021 at 02:41, Heinrich Schuchardt <xypron.glpk@gmx.de> wrote: > > 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> > --- > drivers/core/of_addr.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) Reviewed-by: Simon Glass <sjg@chromium.org> Applied to u-boot-dm/next, thanks!
diff --git a/drivers/core/of_addr.c b/drivers/core/of_addr.c index 5bc6ca1de0..b3e384d2ee 100644 --- a/drivers/core/of_addr.c +++ b/drivers/core/of_addr.c @@ -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; }
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> --- drivers/core/of_addr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.30.0