android_kernel_motorola_sm6225/arch/powerpc/platforms/52xx
Julia Lawall 915b96191f powerpc/5200: efika.c: Add of_node_put to avoid memory leak
This function is implemented as though the function of_get_next_child does
not increment the reference count of its result, but actually it does.
Thus the patch adds of_node_put in error handling code and drops a call to
of_node_get.

The semantic match that finds this problem is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@r exists@
local idexpression x;
expression E1;
position p1,p2;
@@

x@p1 = of_get_next_child(...);
... when != x = E1
of_node_get@p2(x)

@script:python@
p1 << r.p1;
p2 << r.p2;
@@

cocci.print_main("call",p1)
cocci.print_secs("get",p2)
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
2010-09-08 11:45:24 -06:00
..
efika.c powerpc/5200: efika.c: Add of_node_put to avoid memory leak 2010-09-08 11:45:24 -06:00
Kconfig powerpc/5200: add LocalPlus bus FIFO device driver 2009-11-04 16:42:47 -07:00
lite5200.c of/address: Clean up function declarations 2010-08-01 01:42:42 -06:00
lite5200_pm.c powerpc: Clean up obsolete code relating to decrementer and timebase 2010-07-09 11:26:16 +10:00
lite5200_sleep.S
Makefile powerpc/5200: add LocalPlus bus FIFO device driver 2009-11-04 16:42:47 -07:00
media5200.c genirq: Convert irq_desc.lock to raw_spinlock 2009-12-14 23:55:33 +01:00
mpc52xx_common.c powerpc/5200: add mpc5200_psc_ac97_gpio_reset 2010-08-06 20:49:18 -06:00
mpc52xx_gpio.c powerpc: remove references to of_device and to_of_device 2010-07-24 09:58:21 -06:00
mpc52xx_gpt.c powerpc: remove references to of_device and to_of_device 2010-07-24 09:58:21 -06:00
mpc52xx_lpbfifo.c powerpc: remove references to of_device and to_of_device 2010-07-24 09:58:21 -06:00
mpc52xx_pci.c tree-wide: fix assorted typos all over the place 2009-12-04 15:39:55 +01:00
mpc52xx_pic.c powerpc: Make "intspec" pointers in irq_host->xlate() const 2009-12-09 17:10:37 +11:00
mpc52xx_pm.c powerpc: Clean up obsolete code relating to decrementer and timebase 2010-07-09 11:26:16 +10:00
mpc52xx_sleep.S
mpc5200_simple.c mpc5200: support for the MAN mpc5200 based board mucmc52 2009-10-15 09:33:24 -06:00