aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/mscc
diff options
context:
space:
mode:
authorNishka Dasgupta <nishkadg.linux@gmail.com>2019-07-16 11:18:43 +0530
committerDavid S. Miller <davem@davemloft.net>2019-07-16 12:37:30 -0700
commit3cd6e20f54d5003ea895717b67017397056749ce (patch)
treee4e0dd19a54904b1b39244a7d3e9e341433f5814 /drivers/net/ethernet/mscc
parentMerge tag 'mlx5-fixes-2019-07-15' of git://git.kernel.org/pub/scm/linux/kernel/git/saeed/linux (diff)
downloadlinux-dev-3cd6e20f54d5003ea895717b67017397056749ce.tar.xz
linux-dev-3cd6e20f54d5003ea895717b67017397056749ce.zip
net: ethernet: ti: cpsw: Add of_node_put() before return and break
Each iteration of for_each_available_child_of_node puts the previous node, but in the case of a return or break from the middle of the loop, there is no put, thus causing a memory leak. Hence, for function cpsw_probe_dt, create an extra label err_node_put that puts the last used node and returns ret; modify the return statements in the loop to save the return value in ret and goto this new label. For function cpsw_remove_dt, add an of_node_put before the break. Issue found with Coccinelle. Signed-off-by: Nishka Dasgupta <nishkadg.linux@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/mscc')
0 files changed, 0 insertions, 0 deletions