aboutsummaryrefslogtreecommitdiff
path: root/tools/perf/util/c++/clang-test.cpp
diff options
context:
space:
mode:
authorNishka Dasgupta <[email protected]>2019-07-24 13:46:09 +0530
committerVinod Koul <[email protected]>2019-08-08 17:56:50 +0530
commit057b05d5ac4745e7999656223bc6426c0129ba86 (patch)
tree479bebab94ff24da9f6d4f101d3f14493ce4ebf5 /tools/perf/util/c++/clang-test.cpp
parent232a7f18cf8ecbd92a8cc6ca7feee4f6aab668fe (diff)
dmaengine: qcom: hidma_mgmt: Add of_node_put() before goto
Each iteration of for_each_available_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. Hence add an of_node_put under the label that the gotos point to. In order to avoid decrementing an already-decremented refcount, copy the original contents of the label (including the return statement) to just above the label, so that the code under the label is executed only when a goto exit from the loop occurs. Additionally, remove an unnecessary get/put pair from the loop, as the loop itself already keeps track of refcount. Issue found with Coccinelle. Signed-off-by: Nishka Dasgupta <[email protected]> Acked-by: Sinan Kaya <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Vinod Koul <[email protected]>
Diffstat (limited to 'tools/perf/util/c++/clang-test.cpp')
0 files changed, 0 insertions, 0 deletions