diff options
author | Xiyu Yang <[email protected]> | 2020-04-15 16:36:19 +0800 |
---|---|---|
committer | David S. Miller <[email protected]> | 2020-04-18 13:09:46 -0700 |
commit | d03f228470a8c0a22b774d1f8d47071e0de4f6dd (patch) | |
tree | 2b62e9da1a2a8e3346cfd2712abab732dfa4089c /tools/lib/api/fs/tracing_path.c | |
parent | 2fcd80144b93ff90836a44f2054b4d82133d3a85 (diff) |
net: netrom: Fix potential nr_neigh refcnt leak in nr_add_node
nr_add_node() invokes nr_neigh_get_dev(), which returns a local
reference of the nr_neigh object to "nr_neigh" with increased refcnt.
When nr_add_node() returns, "nr_neigh" becomes invalid, so the refcount
should be decreased to keep refcount balanced.
The issue happens in one normal path of nr_add_node(), which forgets to
decrease the refcnt increased by nr_neigh_get_dev() and causes a refcnt
leak. It should decrease the refcnt before the function returns like
other normal paths do.
Fix this issue by calling nr_neigh_put() before the nr_add_node()
returns.
Signed-off-by: Xiyu Yang <[email protected]>
Signed-off-by: Xin Tan <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
Diffstat (limited to 'tools/lib/api/fs/tracing_path.c')
0 files changed, 0 insertions, 0 deletions