diff options
| author | Xiyu Yang <xiyuyang19@fudan.edu.cn> | 2020-04-23 13:14:55 +0800 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-04-23 13:37:25 +0200 |
| commit | 57a66838e1494cd881b7f4e110ec685736e8e3ca (patch) | |
| tree | 7c207960e1f99ced41476e6ad122e4a9935433c9 /tools/perf/scripts/python/export-to-postgresql.py | |
| parent | 5975b85ae244dd607965518129e816e4072bc976 (diff) | |
| download | linux-57a66838e1494cd881b7f4e110ec685736e8e3ca.tar.gz linux-57a66838e1494cd881b7f4e110ec685736e8e3ca.zip | |
staging: gasket: Fix mapping refcnt leak when put attribute fails
gasket_sysfs_put_attr() invokes get_mapping(), which returns a reference
of the specified gasket_sysfs_mapping object to "mapping" with increased
refcnt.
When gasket_sysfs_put_attr() returns, local variable "mapping" becomes
invalid, so the refcount should be decreased to keep refcount balanced.
The reference counting issue happens in one path of
gasket_sysfs_put_attr(). When mapping attribute is unknown, the function
forgets to decrease the refcnt increased by get_mapping(), causing a
refcnt leak.
Fix this issue by calling put_mapping() when put attribute fails due to
unknown attribute.
Signed-off-by: Xiyu Yang <xiyuyang19@fudan.edu.cn>
Signed-off-by: Xin Tan <tanxin.ctf@gmail.com>
Link: https://lore.kernel.org/r/1587618895-13660-1-git-send-email-xiyuyang19@fudan.edu.cn
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'tools/perf/scripts/python/export-to-postgresql.py')
0 files changed, 0 insertions, 0 deletions
