]> git.baikalelectronics.ru Git - kernel.git/commit
Input: mtk-pmic-keys - add of_node_put() before return
authorNishka Dasgupta <nishkadg.linux@gmail.com>
Fri, 12 Jul 2019 06:49:47 +0000 (23:49 -0700)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Fri, 12 Jul 2019 06:56:05 +0000 (23:56 -0700)
commitfa8c17e589a9c824d4f62a1cc3eeff4472ba9f42
tree92877ec29739e0ff5d7ca0abd6b45da96ae8afa3
parent6c9bbf21c66952db9a337e020767d2ccad6d3d9a
Input: mtk-pmic-keys - 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 add an of_node_put before the
return in three places.
Issue found with Coccinelle.

Signed-off-by: Nishka Dasgupta <nishkadg.linux@gmail.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
drivers/input/keyboard/mtk-pmic-keys.c