diff mbox series

[2/2] bus: integrator-lm: fix OF node leak in probe()

Message ID 20240826054934.10724-2-krzysztof.kozlowski@linaro.org (mailing list archive)
State New, archived
Headers show
Series [1/2] ARM: versatile: fix OF node leak in CPUs prepare | expand

Commit Message

Krzysztof Kozlowski Aug. 26, 2024, 5:49 a.m. UTC
Driver code is leaking OF node reference from of_find_matching_node() in
probe().

Fixes: ccea5e8a5918 ("bus: Add driver for Integrator/AP logic modules")
Cc: <stable@vger.kernel.org>
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---
 drivers/bus/arm-integrator-lm.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Liviu Dudau Aug. 29, 2024, 12:34 p.m. UTC | #1
On Mon, Aug 26, 2024 at 07:49:34AM +0200, Krzysztof Kozlowski wrote:
> Driver code is leaking OF node reference from of_find_matching_node() in
> probe().
> 
> Fixes: ccea5e8a5918 ("bus: Add driver for Integrator/AP logic modules")
> Cc: <stable@vger.kernel.org>
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

Acked-by: Liviu Dudau <liviu.dudau@arm.com>

Best regards,
Liviu

> ---
>  drivers/bus/arm-integrator-lm.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/bus/arm-integrator-lm.c b/drivers/bus/arm-integrator-lm.c
> index b715c8ab36e8..a65c79b08804 100644
> --- a/drivers/bus/arm-integrator-lm.c
> +++ b/drivers/bus/arm-integrator-lm.c
> @@ -85,6 +85,7 @@ static int integrator_ap_lm_probe(struct platform_device *pdev)
>  		return -ENODEV;
>  	}
>  	map = syscon_node_to_regmap(syscon);
> +	of_node_put(syscon);
>  	if (IS_ERR(map)) {
>  		dev_err(dev,
>  			"could not find Integrator/AP system controller\n");
> -- 
> 2.43.0
>
diff mbox series

Patch

diff --git a/drivers/bus/arm-integrator-lm.c b/drivers/bus/arm-integrator-lm.c
index b715c8ab36e8..a65c79b08804 100644
--- a/drivers/bus/arm-integrator-lm.c
+++ b/drivers/bus/arm-integrator-lm.c
@@ -85,6 +85,7 @@  static int integrator_ap_lm_probe(struct platform_device *pdev)
 		return -ENODEV;
 	}
 	map = syscon_node_to_regmap(syscon);
+	of_node_put(syscon);
 	if (IS_ERR(map)) {
 		dev_err(dev,
 			"could not find Integrator/AP system controller\n");