From: Johan Hovold <johan@kernel.org>
To: Neil Armstrong <neil.armstrong@linaro.org>,
Kevin Hilman <khilman@baylibre.com>
Cc: Jerome Brunet <jbrunet@baylibre.com>,
Martin Blumenstingl <martin.blumenstingl@googlemail.com>,
linux-amlogic@lists.infradead.org, linux-kernel@vger.kernel.org,
Johan Hovold <johan@kernel.org>
Subject: [PATCH 2/2] soc: amlogic: canvas: simplify lookup error handling
Date: Fri, 26 Sep 2025 16:24:54 +0200 [thread overview]
Message-ID: <20250926142454.5929-3-johan@kernel.org> (raw)
In-Reply-To: <20250926142454.5929-1-johan@kernel.org>
Simplify the canvas lookup error handling by dropping the OF node
reference sooner.
Signed-off-by: Johan Hovold <johan@kernel.org>
---
drivers/soc/amlogic/meson-canvas.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/drivers/soc/amlogic/meson-canvas.c b/drivers/soc/amlogic/meson-canvas.c
index 0711088da5dc..79681afea8c6 100644
--- a/drivers/soc/amlogic/meson-canvas.c
+++ b/drivers/soc/amlogic/meson-canvas.c
@@ -60,12 +60,9 @@ struct meson_canvas *meson_canvas_get(struct device *dev)
return ERR_PTR(-ENODEV);
canvas_pdev = of_find_device_by_node(canvas_node);
- if (!canvas_pdev) {
- of_node_put(canvas_node);
- return ERR_PTR(-EPROBE_DEFER);
- }
-
of_node_put(canvas_node);
+ if (!canvas_pdev)
+ return ERR_PTR(-EPROBE_DEFER);
/*
* If priv is NULL, it's probably because the canvas hasn't
--
2.49.1
_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic
WARNING: multiple messages have this Message-ID (diff)
From: Johan Hovold <johan@kernel.org>
To: Neil Armstrong <neil.armstrong@linaro.org>,
Kevin Hilman <khilman@baylibre.com>
Cc: Jerome Brunet <jbrunet@baylibre.com>,
Martin Blumenstingl <martin.blumenstingl@googlemail.com>,
linux-amlogic@lists.infradead.org, linux-kernel@vger.kernel.org,
Johan Hovold <johan@kernel.org>
Subject: [PATCH 2/2] soc: amlogic: canvas: simplify lookup error handling
Date: Fri, 26 Sep 2025 16:24:54 +0200 [thread overview]
Message-ID: <20250926142454.5929-3-johan@kernel.org> (raw)
In-Reply-To: <20250926142454.5929-1-johan@kernel.org>
Simplify the canvas lookup error handling by dropping the OF node
reference sooner.
Signed-off-by: Johan Hovold <johan@kernel.org>
---
drivers/soc/amlogic/meson-canvas.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/drivers/soc/amlogic/meson-canvas.c b/drivers/soc/amlogic/meson-canvas.c
index 0711088da5dc..79681afea8c6 100644
--- a/drivers/soc/amlogic/meson-canvas.c
+++ b/drivers/soc/amlogic/meson-canvas.c
@@ -60,12 +60,9 @@ struct meson_canvas *meson_canvas_get(struct device *dev)
return ERR_PTR(-ENODEV);
canvas_pdev = of_find_device_by_node(canvas_node);
- if (!canvas_pdev) {
- of_node_put(canvas_node);
- return ERR_PTR(-EPROBE_DEFER);
- }
-
of_node_put(canvas_node);
+ if (!canvas_pdev)
+ return ERR_PTR(-EPROBE_DEFER);
/*
* If priv is NULL, it's probably because the canvas hasn't
--
2.49.1
next prev parent reply other threads:[~2025-09-26 14:25 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-26 14:24 [PATCH 0/2] soc: amlogic: canvas: fix device leak on lookup Johan Hovold
2025-09-26 14:24 ` Johan Hovold
2025-09-26 14:24 ` [PATCH 1/2] " Johan Hovold
2025-09-26 14:24 ` Johan Hovold
2025-09-26 19:15 ` Markus Elfring
2025-09-26 19:15 ` Markus Elfring
2025-10-04 19:52 ` Martin Blumenstingl
2025-10-04 19:52 ` Martin Blumenstingl
2025-09-26 14:24 ` Johan Hovold [this message]
2025-09-26 14:24 ` [PATCH 2/2] soc: amlogic: canvas: simplify lookup error handling Johan Hovold
2025-09-26 19:18 ` Markus Elfring
2025-09-26 19:18 ` Markus Elfring
2025-10-04 19:53 ` Martin Blumenstingl
2025-10-04 19:53 ` Martin Blumenstingl
2025-10-21 12:29 ` [PATCH 0/2] soc: amlogic: canvas: fix device leak on lookup Neil Armstrong
2025-10-21 12:29 ` Neil Armstrong
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250926142454.5929-3-johan@kernel.org \
--to=johan@kernel.org \
--cc=jbrunet@baylibre.com \
--cc=khilman@baylibre.com \
--cc=linux-amlogic@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=martin.blumenstingl@googlemail.com \
--cc=neil.armstrong@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.