Home
last modified time | relevance | path

Searched hist:"79937 a4b" (Results 1 – 1 of 1) sorted by relevance

/openbmc/linux/drivers/leds/
H A Dleds-ns2.c79937a4b Tue Jul 16 02:24:24 CDT 2019 Nishka Dasgupta <nishkadg.linux@gmail.com> leds: ns2: Add of_node_put() before return

Each iteration of for_each_child_of_node puts the previous node, but in
the case of a return from the middle of the loop, there is no put, thus
causing a memory leak. Hence create a new label, err_node_put, that puts
the previous node before returning the required value. Edit the mid-loop
return sites to instead go to this new label.
Issue found with Coccinelle.

Signed-off-by: Nishka Dasgupta <nishkadg.linux@gmail.com>
Signed-off-by: Jacek Anaszewski <jacek.anaszewski@gmail.com>
79937a4b Tue Jul 16 02:24:24 CDT 2019 Nishka Dasgupta <nishkadg.linux@gmail.com> leds: ns2: Add of_node_put() before return

Each iteration of for_each_child_of_node puts the previous node, but in
the case of a return from the middle of the loop, there is no put, thus
causing a memory leak. Hence create a new label, err_node_put, that puts
the previous node before returning the required value. Edit the mid-loop
return sites to instead go to this new label.
Issue found with Coccinelle.

Signed-off-by: Nishka Dasgupta <nishkadg.linux@gmail.com>
Signed-off-by: Jacek Anaszewski <jacek.anaszewski@gmail.com>