summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/bpf/progs/test_autoload.c
diff options
context:
space:
mode:
authorXin Xiong <xiongx18@fudan.edu.cn>2020-07-29 16:06:59 +0300
committerDavid S. Miller <davem@davemloft.net>2020-07-31 03:35:53 +0300
commit51875dad43b44241b46a569493f1e4bfa0386d86 (patch)
tree31e2041f798d1a07bc34de829316aac83526cc41 /tools/testing/selftests/bpf/progs/test_autoload.c
parent555a893303872e044fb86f0a5834ce78d41ad2e2 (diff)
downloadlinux-51875dad43b44241b46a569493f1e4bfa0386d86.tar.xz
atm: fix atm_dev refcnt leaks in atmtcp_remove_persistent
atmtcp_remove_persistent() invokes atm_dev_lookup(), which returns a reference of atm_dev with increased refcount or NULL if fails. The refcount leaks issues occur in two error handling paths. If dev_data->persist is zero or PRIV(dev)->vcc isn't NULL, the function returns 0 without decreasing the refcount kept by a local variable, resulting in refcount leaks. Fix the issue by adding atm_dev_put() before returning 0 both when dev_data->persist is zero or PRIV(dev)->vcc isn't NULL. Signed-off-by: Xin Xiong <xiongx18@fudan.edu.cn> Signed-off-by: Xiyu Yang <xiyuyang19@fudan.edu.cn> Signed-off-by: Xin Tan <tanxin.ctf@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'tools/testing/selftests/bpf/progs/test_autoload.c')
0 files changed, 0 insertions, 0 deletions