Each iteration of for_each_child_of_node puts the previous node, but in
the case of a break from the middle of the loop, there is no put, thus
causing a memory leak. Hence add an of_node_put before the break.
Issue found with Coccinelle.
Cc: <[email protected]>
Signed-off-by: Nishka Dasgupta <[email protected]>
[Bartosz: tweaked the commit message]
Signed-off-by: Bartosz Golaszewski <[email protected]>
of_node_full_name(child));
*flags |= OF_GPIO_ACTIVE_LOW;
}
+ of_node_put(child);
break;
}
}