Skip to content

Commit 391b41f

Browse files
Fabrizio CastroBartosz Golaszewski
authored andcommitted
gpio: rcar: Fix missing of_node_put() call
of_parse_phandle_with_fixed_args() requires its caller to call into of_node_put() on the node pointer from the output structure, but such a call is currently missing. Call into of_node_put() to rectify that. Fixes: 159f8a0 ("gpio-rcar: Add DT support") Signed-off-by: Fabrizio Castro <fabrizio.castro.jz@renesas.com> Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> Link: https://lore.kernel.org/r/20250305163753.34913-2-fabrizio.castro.jz@renesas.com Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
1 parent f02c41f commit 391b41f

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

drivers/gpio/gpio-rcar.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -468,7 +468,12 @@ static int gpio_rcar_parse_dt(struct gpio_rcar_priv *p, unsigned int *npins)
468468
p->info = *info;
469469

470470
ret = of_parse_phandle_with_fixed_args(np, "gpio-ranges", 3, 0, &args);
471-
*npins = ret == 0 ? args.args[2] : RCAR_MAX_GPIO_PER_BANK;
471+
if (ret) {
472+
*npins = RCAR_MAX_GPIO_PER_BANK;
473+
} else {
474+
*npins = args.args[2];
475+
of_node_put(args.np);
476+
}
472477

473478
if (*npins == 0 || *npins > RCAR_MAX_GPIO_PER_BANK) {
474479
dev_warn(p->dev, "Invalid number of gpio lines %u, using %u\n",

0 commit comments

Comments
 (0)