]> git.baikalelectronics.ru Git - kernel.git/commit
ata: libahci_platform: Add of_node_put() before loop exit
authorNishka Dasgupta <nishkadg.linux@gmail.com>
Thu, 15 Aug 2019 06:00:14 +0000 (11:30 +0530)
committerJens Axboe <axboe@kernel.dk>
Thu, 19 Sep 2019 18:21:44 +0000 (12:21 -0600)
commit345e160f466b584b6d1f0dc29cf5cba619a22afe
treee2d5fba6e85021f13d3c9ff8aa44101227512344
parent32cf06a4f8ebea1956c471f29c4170cab2aa6452
ata: libahci_platform: Add of_node_put() before loop exit

Each iteration of for_each_child_of_node puts the previous node, but
in the case of a goto from the middle of the loop, there is no put,
thus causing a memory leak. Add an of_node_put before three such goto
statements.
Issue found with Coccinelle.

Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Nishka Dasgupta <nishkadg.linux@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/ata/libahci_platform.c