From: Julia Lawall <hidden> Date: 2011-08-20 07:23:56
From: Julia Lawall <redacted>
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 <redacted>
---
sound/soc/fsl/fsl_dma.c | 2 ++
1 file changed, 2 insertions(+)
From: Julia Lawall <redacted>
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 <redacted>
---
sound/soc/fsl/fsl_dma.c | 2 ++
1 file changed, 2 insertions(+)
Thanks for catching the problem, Julia, but the fix is not quite correct. My
code assumes that of_parse_phandle() doesn't claim the node, but it doesn't
actually use the node pointer, either. All I care about is whether 'np' is
equal to dma_channel_np. I'm not going to use 'np'. So I think the real fix is
this:
Thanks for catching the problem, Julia, but the fix is not quite correct. My
code assumes that of_parse_phandle() doesn't claim the node, but it doesn't
actually use the node pointer, either. All I care about is whether 'np' is
equal to dma_channel_np. I'm not going to use 'np'. So I think the real fix is
this: