From: nicolas.ferre@atmel•com (Nicolas Ferre)
To: linux-arm-kernel@lists•infradead.org
Subject: [PATCH] drm: atmel-hlcdc: Fix OF graph parsing
Date: Tue, 21 Jun 2016 14:00:51 +0200 [thread overview]
Message-ID: <57692C73.8020109@atmel.com> (raw)
In-Reply-To: <1464938795-1838-1-git-send-email-boris.brezillon@free-electrons.com>
Le 03/06/2016 09:26, Boris Brezillon a ?crit :
> atmel_hlcdc_create_outputs() iterates over OF graph nodes and releases
> the node (using of_node_put()) after each iteration, which is wrong
> since for_each_endpoint_of_node() is already taking care of that.
>
> Move the of_node_put() call in the error path.
>
> Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons•com>
> Fixes: 17a8e03e7e97 ("drm: atmel-hlcdc: rework the output code to support drm bridges")
Reviewed-by: Nicolas Ferre <nicolas.ferre@atmel•com>
> ---
> drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_output.c | 10 ++++++----
> 1 file changed, 6 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_output.c b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_output.c
> index 39802c0..3d34fc4 100644
> --- a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_output.c
> +++ b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_output.c
> @@ -266,9 +266,10 @@ int atmel_hlcdc_create_outputs(struct drm_device *dev)
> if (!ret)
> ret = atmel_hlcdc_check_endpoint(dev, &ep);
>
> - of_node_put(ep_np);
> - if (ret)
> + if (ret) {
> + of_node_put(ep_np);
> return ret;
> + }
> }
>
> for_each_endpoint_of_node(dev->dev->of_node, ep_np) {
> @@ -276,9 +277,10 @@ int atmel_hlcdc_create_outputs(struct drm_device *dev)
> if (!ret)
> ret = atmel_hlcdc_attach_endpoint(dev, &ep);
>
> - of_node_put(ep_np);
> - if (ret)
> + if (ret) {
> + of_node_put(ep_np);
> return ret;
> + }
> }
>
> return 0;
>
--
Nicolas Ferre
prev parent reply other threads:[~2016-06-21 12:00 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-03 7:26 [PATCH] drm: atmel-hlcdc: Fix OF graph parsing Boris Brezillon
2016-06-21 12:00 ` Nicolas Ferre [this message]
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=57692C73.8020109@atmel.com \
--to=nicolas.ferre@atmel$(echo .)com \
--cc=linux-arm-kernel@lists$(echo .)infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox