mirror of https://github.com/torvalds/linux.git
for_each_matching_node performs an of_node_get on each iteration, so a break out of the loop requires an of_node_put. A simplified version of the semantic patch that fixes this problem is as follows (http://coccinelle.lip6.fr): // <smpl> @@ expression e,e1; local idexpression np; @@ for_each_matching_node(np, e1) { ... when != of_node_put(np) when != e = np ( return np; | + of_node_put(np); ? return ...; ) ... } // </smpl> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> Signed-off-by: Sebastian Reichel <sre@kernel.org> |
||
|---|---|---|
| .. | ||
| Kconfig | ||
| Makefile | ||
| arm-versatile-reboot.c | ||
| as3722-poweroff.c | ||
| at91-poweroff.c | ||
| at91-reset.c | ||
| axxia-reset.c | ||
| brcmstb-reboot.c | ||
| gpio-poweroff.c | ||
| gpio-restart.c | ||
| hisi-reboot.c | ||
| imx-snvs-poweroff.c | ||
| keystone-reset.c | ||
| ltc2952-poweroff.c | ||
| msm-poweroff.c | ||
| qnap-poweroff.c | ||
| restart-poweroff.c | ||
| rmobile-reset.c | ||
| st-poweroff.c | ||
| syscon-poweroff.c | ||
| syscon-reboot.c | ||
| vexpress-poweroff.c | ||
| xgene-reboot.c | ||
| zx-reboot.c | ||