From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 81FB81BD00C; Tue, 11 Mar 2025 15:18:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741706298; cv=none; b=ZuH4DG8Jz2zXeVLrtVoAQU9SMkylkCEW78Hy0sWCMbOs/Qk2DKS5F59WpjGyxPs4wmSkWR5B6ZNtY19xTyOYy9pn7ihfM2FAh+WK1b31mR4KlFS0H410EOGbRY5gXQfSpOnY7tPqGxhnMuPlzGo9+DFfRi5viFhOr4XwooYKDnc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741706298; c=relaxed/simple; bh=CNj7WH6GKXQZ7hBz5CSmVVWFX2oobD5b4pq6Um/k0D4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=HoJUzKyk2nT2hz6V/lEPzoVvFRQCc/waZ8cizCnQwILxiHjxJfMBkTK8EjPxmuk0M9h1gcsGav7NFX5jyEHQg/fq6sMvWRcKRyI6pueHjMDf6dbWmBG9HnVXhqwJIYsKU9KNugcxYmtEfDVGf4PIzorCtF8y8Plzq2mDN6FpTwA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=T4zeQwqy; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="T4zeQwqy" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 09800C4CEE9; Tue, 11 Mar 2025 15:18:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1741706298; bh=CNj7WH6GKXQZ7hBz5CSmVVWFX2oobD5b4pq6Um/k0D4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=T4zeQwqy+FfPFyzflNbF2fpVW+2cvVrdMklC6s8EzZ9zr93fxfjh6tJPM962KJk2e UMFx6RNZ4kFb9Ff9qHibYJh7vpBwaItgVyjAMIEDjG+8Aic74sIW+sDJ6FU8shUBg5 a5kCOj4ev/FXMRGB7mk8T14X0KNQ5F48+DjqjfZs= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Fabrizio Castro , Lad Prabhakar , Geert Uytterhoeven , Bartosz Golaszewski , Sasha Levin Subject: [PATCH 5.4 310/328] gpio: rcar: Fix missing of_node_put() call Date: Tue, 11 Mar 2025 16:01:20 +0100 Message-ID: <20250311145727.229765393@linuxfoundation.org> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250311145714.865727435@linuxfoundation.org> References: <20250311145714.865727435@linuxfoundation.org> User-Agent: quilt/0.68 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 5.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: Fabrizio Castro [ Upstream commit 391b41f983bf7ff853de44704d8e14e7cc648a9b ] 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: 159f8a0209af ("gpio-rcar: Add DT support") Signed-off-by: Fabrizio Castro Reviewed-by: Lad Prabhakar Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/r/20250305163753.34913-2-fabrizio.castro.jz@renesas.com Signed-off-by: Bartosz Golaszewski Signed-off-by: Sasha Levin --- drivers/gpio/gpio-rcar.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/gpio/gpio-rcar.c b/drivers/gpio/gpio-rcar.c index f0b6c68e848e3..37b731d22cb00 100644 --- a/drivers/gpio/gpio-rcar.c +++ b/drivers/gpio/gpio-rcar.c @@ -418,7 +418,12 @@ static int gpio_rcar_parse_dt(struct gpio_rcar_priv *p, unsigned int *npins) p->has_both_edge_trigger = info->has_both_edge_trigger; ret = of_parse_phandle_with_fixed_args(np, "gpio-ranges", 3, 0, &args); - *npins = ret == 0 ? args.args[2] : RCAR_MAX_GPIO_PER_BANK; + if (ret) { + *npins = RCAR_MAX_GPIO_PER_BANK; + } else { + *npins = args.args[2]; + of_node_put(args.np); + } if (*npins == 0 || *npins > RCAR_MAX_GPIO_PER_BANK) { dev_warn(p->dev, "Invalid number of gpio lines %u, using %u\n", -- 2.39.5