From: Liam Girdwood <lrg@ti.com>
To: Julia Lawall <julia@diku.dk>
Cc: "alsa-devel@alsa-project.org" <alsa-devel@alsa-project.org>,
Takashi Iwai <tiwai@suse.de>,
"devicetree-discuss@lists.ozlabs.org"
<devicetree-discuss@lists.ozlabs.org>,
Mark Brown <broonie@opensource.wolfsonmicro.com>,
"kernel-janitors@vger.kernel.org"
<kernel-janitors@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Grant Likely <grant.likely@secretlab.ca>,
"linuxppc-dev@lists.ozlabs.org" <linuxppc-dev@lists.ozlabs.org>,
Timur Tabi <timur@freescale.com>
Subject: Re: [PATCH] sound/soc/fsl/fsl_dma.c: add missing of_node_put
Date: Mon, 22 Aug 2011 11:18:42 +0100 [thread overview]
Message-ID: <4E522D02.9020809@ti.com> (raw)
In-Reply-To: <1313825025-17590-1-git-send-email-julia@diku.dk>
On 20/08/11 08:23, Julia Lawall wrote:
> From: Julia Lawall <julia@diku.dk>
>
> of_parse_phandle increments the reference count of np, so this should be
> decremented before trying the next possibility.
>
> The semantic match that finds this problem is as follows:
> (http://coccinelle.lip6.fr/)
>
> // <smpl>
> @@
> expression e,e1,e2;
> @@
>
> *e = of_parse_phandle(...)
> ... when != of_node_put(e)
> when != true e == NULL
> when != e2 = e
> e = e1
> // </smpl>
>
> Signed-off-by: Julia Lawall <julia@diku.dk>
>
> ---
> sound/soc/fsl/fsl_dma.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/sound/soc/fsl/fsl_dma.c b/sound/soc/fsl/fsl_dma.c
> index 0efc04a..b33271b 100644
> --- a/sound/soc/fsl/fsl_dma.c
> +++ b/sound/soc/fsl/fsl_dma.c
> @@ -880,10 +880,12 @@ static struct device_node *find_ssi_node(struct device_node *dma_channel_np)
> np = of_parse_phandle(ssi_np, "fsl,playback-dma", 0);
> if (np == dma_channel_np)
> return ssi_np;
> + of_node_put(np);
>
> np = of_parse_phandle(ssi_np, "fsl,capture-dma", 0);
> if (np == dma_channel_np)
> return ssi_np;
> + of_node_put(np);
> }
>
> return NULL;
>
Acked-by: Liam Girdwood <lrg@ti.com>
WARNING: multiple messages have this Message-ID (diff)
From: Liam Girdwood <lrg@ti.com>
To: Julia Lawall <julia@diku.dk>
Cc: "alsa-devel@alsa-project.org" <alsa-devel@alsa-project.org>,
Takashi Iwai <tiwai@suse.de>,
"devicetree-discuss@lists.ozlabs.org"
<devicetree-discuss@lists.ozlabs.org>,
Mark Brown <broonie@opensource.wolfsonmicro.com>,
"kernel-janitors@vger.kernel.org"
<kernel-janitors@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Grant Likely <grant.likely@secretlab.ca>,
"linuxppc-dev@lists.ozlabs.org" <linuxppc-dev@lists.ozlabs.org>,
Timur Tabi <timur@freescale.com>
Subject: Re: [PATCH] sound/soc/fsl/fsl_dma.c: add missing of_node_put
Date: Mon, 22 Aug 2011 10:18:42 +0000 [thread overview]
Message-ID: <4E522D02.9020809@ti.com> (raw)
In-Reply-To: <1313825025-17590-1-git-send-email-julia@diku.dk>
On 20/08/11 08:23, Julia Lawall wrote:
> From: Julia Lawall <julia@diku.dk>
>
> of_parse_phandle increments the reference count of np, so this should be
> decremented before trying the next possibility.
>
> The semantic match that finds this problem is as follows:
> (http://coccinelle.lip6.fr/)
>
> // <smpl>
> @@
> expression e,e1,e2;
> @@
>
> *e = of_parse_phandle(...)
> ... when != of_node_put(e)
> when != true e = NULL
> when != e2 = e
> e = e1
> // </smpl>
>
> Signed-off-by: Julia Lawall <julia@diku.dk>
>
> ---
> sound/soc/fsl/fsl_dma.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/sound/soc/fsl/fsl_dma.c b/sound/soc/fsl/fsl_dma.c
> index 0efc04a..b33271b 100644
> --- a/sound/soc/fsl/fsl_dma.c
> +++ b/sound/soc/fsl/fsl_dma.c
> @@ -880,10 +880,12 @@ static struct device_node *find_ssi_node(struct device_node *dma_channel_np)
> np = of_parse_phandle(ssi_np, "fsl,playback-dma", 0);
> if (np = dma_channel_np)
> return ssi_np;
> + of_node_put(np);
>
> np = of_parse_phandle(ssi_np, "fsl,capture-dma", 0);
> if (np = dma_channel_np)
> return ssi_np;
> + of_node_put(np);
> }
>
> return NULL;
>
Acked-by: Liam Girdwood <lrg@ti.com>
WARNING: multiple messages have this Message-ID (diff)
From: Liam Girdwood <lrg@ti.com>
To: Julia Lawall <julia@diku.dk>
Cc: "alsa-devel@alsa-project.org" <alsa-devel@alsa-project.org>,
Takashi Iwai <tiwai@suse.de>,
"devicetree-discuss@lists.ozlabs.org"
<devicetree-discuss@lists.ozlabs.org>,
Mark Brown <broonie@opensource.wolfsonmicro.com>,
"kernel-janitors@vger.kernel.org"
<kernel-janitors@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Jaroslav Kysela <perex@perex.cz>,
"linuxppc-dev@lists.ozlabs.org" <linuxppc-dev@lists.ozlabs.org>,
Timur Tabi <timur@freescale.com>
Subject: Re: [PATCH] sound/soc/fsl/fsl_dma.c: add missing of_node_put
Date: Mon, 22 Aug 2011 11:18:42 +0100 [thread overview]
Message-ID: <4E522D02.9020809@ti.com> (raw)
In-Reply-To: <1313825025-17590-1-git-send-email-julia@diku.dk>
On 20/08/11 08:23, Julia Lawall wrote:
> From: Julia Lawall <julia@diku.dk>
>
> of_parse_phandle increments the reference count of np, so this should be
> decremented before trying the next possibility.
>
> The semantic match that finds this problem is as follows:
> (http://coccinelle.lip6.fr/)
>
> // <smpl>
> @@
> expression e,e1,e2;
> @@
>
> *e = of_parse_phandle(...)
> ... when != of_node_put(e)
> when != true e == NULL
> when != e2 = e
> e = e1
> // </smpl>
>
> Signed-off-by: Julia Lawall <julia@diku.dk>
>
> ---
> sound/soc/fsl/fsl_dma.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/sound/soc/fsl/fsl_dma.c b/sound/soc/fsl/fsl_dma.c
> index 0efc04a..b33271b 100644
> --- a/sound/soc/fsl/fsl_dma.c
> +++ b/sound/soc/fsl/fsl_dma.c
> @@ -880,10 +880,12 @@ static struct device_node *find_ssi_node(struct device_node *dma_channel_np)
> np = of_parse_phandle(ssi_np, "fsl,playback-dma", 0);
> if (np == dma_channel_np)
> return ssi_np;
> + of_node_put(np);
>
> np = of_parse_phandle(ssi_np, "fsl,capture-dma", 0);
> if (np == dma_channel_np)
> return ssi_np;
> + of_node_put(np);
> }
>
> return NULL;
>
Acked-by: Liam Girdwood <lrg@ti.com>
WARNING: multiple messages have this Message-ID (diff)
From: Liam Girdwood <lrg@ti.com>
To: Julia Lawall <julia@diku.dk>
Cc: Timur Tabi <timur@freescale.com>,
"kernel-janitors@vger.kernel.org"
<kernel-janitors@vger.kernel.org>,
Mark Brown <broonie@opensource.wolfsonmicro.com>,
Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.de>,
Grant Likely <grant.likely@secretlab.ca>,
"alsa-devel@alsa-project.org" <alsa-devel@alsa-project.org>,
"linuxppc-dev@lists.ozlabs.org" <linuxppc-dev@lists.ozlabs.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"devicetree-discuss@lists.ozlabs.org"
<devicetree-discuss@lists.ozlabs.org>
Subject: Re: [PATCH] sound/soc/fsl/fsl_dma.c: add missing of_node_put
Date: Mon, 22 Aug 2011 11:18:42 +0100 [thread overview]
Message-ID: <4E522D02.9020809@ti.com> (raw)
In-Reply-To: <1313825025-17590-1-git-send-email-julia@diku.dk>
On 20/08/11 08:23, Julia Lawall wrote:
> From: Julia Lawall <julia@diku.dk>
>
> of_parse_phandle increments the reference count of np, so this should be
> decremented before trying the next possibility.
>
> The semantic match that finds this problem is as follows:
> (http://coccinelle.lip6.fr/)
>
> // <smpl>
> @@
> expression e,e1,e2;
> @@
>
> *e = of_parse_phandle(...)
> ... when != of_node_put(e)
> when != true e == NULL
> when != e2 = e
> e = e1
> // </smpl>
>
> Signed-off-by: Julia Lawall <julia@diku.dk>
>
> ---
> sound/soc/fsl/fsl_dma.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/sound/soc/fsl/fsl_dma.c b/sound/soc/fsl/fsl_dma.c
> index 0efc04a..b33271b 100644
> --- a/sound/soc/fsl/fsl_dma.c
> +++ b/sound/soc/fsl/fsl_dma.c
> @@ -880,10 +880,12 @@ static struct device_node *find_ssi_node(struct device_node *dma_channel_np)
> np = of_parse_phandle(ssi_np, "fsl,playback-dma", 0);
> if (np == dma_channel_np)
> return ssi_np;
> + of_node_put(np);
>
> np = of_parse_phandle(ssi_np, "fsl,capture-dma", 0);
> if (np == dma_channel_np)
> return ssi_np;
> + of_node_put(np);
> }
>
> return NULL;
>
Acked-by: Liam Girdwood <lrg@ti.com>
next prev parent reply other threads:[~2011-08-22 10:18 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-20 7:23 [PATCH] sound/soc/fsl/fsl_dma.c: add missing of_node_put Julia Lawall
2011-08-20 7:23 ` Julia Lawall
2011-08-20 7:23 ` Julia Lawall
2011-08-20 7:23 ` Julia Lawall
2011-08-22 10:18 ` Liam Girdwood [this message]
2011-08-22 10:18 ` Liam Girdwood
2011-08-22 10:18 ` Liam Girdwood
2011-08-22 10:18 ` Liam Girdwood
2011-08-22 14:03 ` Timur Tabi
2011-08-22 14:03 ` Timur Tabi
2011-08-22 14:03 ` Timur Tabi
2011-08-22 14:03 ` Timur Tabi
[not found] ` <4E5261A5.5050608-KZfg59tc24xl57MIdRCFDg@public.gmane.org>
2011-08-22 14:06 ` Julia Lawall
2011-08-22 14:06 ` Julia Lawall
2011-08-22 14:06 ` Julia Lawall
2011-08-22 14:06 ` Julia Lawall
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=4E522D02.9020809@ti.com \
--to=lrg@ti.com \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@opensource.wolfsonmicro.com \
--cc=devicetree-discuss@lists.ozlabs.org \
--cc=grant.likely@secretlab.ca \
--cc=julia@diku.dk \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=timur@freescale.com \
--cc=tiwai@suse.de \
/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.