[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4E522D02.9020809@ti.com>
Date: Mon, 22 Aug 2011 11:18:42 +0100
From: Liam Girdwood <lrg@...com>
To: Julia Lawall <julia@...u.dk>
CC: Timur Tabi <timur@...escale.com>,
"kernel-janitors@...r.kernel.org" <kernel-janitors@...r.kernel.org>,
Mark Brown <broonie@...nsource.wolfsonmicro.com>,
Jaroslav Kysela <perex@...ex.cz>, Takashi Iwai <tiwai@...e.de>,
Grant Likely <grant.likely@...retlab.ca>,
"alsa-devel@...a-project.org" <alsa-devel@...a-project.org>,
"linuxppc-dev@...ts.ozlabs.org" <linuxppc-dev@...ts.ozlabs.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"devicetree-discuss@...ts.ozlabs.org"
<devicetree-discuss@...ts.ozlabs.org>
Subject: Re: [PATCH] sound/soc/fsl/fsl_dma.c: add missing of_node_put
On 20/08/11 08:23, Julia Lawall wrote:
> From: Julia Lawall <julia@...u.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@...u.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@...com>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists