diff options
| author | Xiyu Yang <[email protected]> | 2020-04-23 13:15:40 +0800 |
|---|---|---|
| committer | Greg Kroah-Hartman <[email protected]> | 2020-04-23 13:37:25 +0200 |
| commit | e3436ce60cf5f5eaedda2b8c622f69feb97595e2 (patch) | |
| tree | 57c778bf2315aaa7509b085b7c3b4a892e547158 /tools/perf/scripts/python/bin | |
| parent | 57a66838e1494cd881b7f4e110ec685736e8e3ca (diff) | |
staging: gasket: Fix mapping refcnt leak when register/store fails
gasket_sysfs_register_store() invokes get_mapping(), which returns a
reference of the specified gasket_sysfs_mapping object to "mapping" with
increased refcnt.
When gasket_sysfs_register_store() returns, local variable "mapping"
becomes invalid, so the refcount should be decreased to keep refcount
balanced.
The reference counting issue happens in one exception handling path of
gasket_sysfs_register_store(). When gasket_dev is NULL, the function
forgets to decrease the refcnt increased by get_mapping(), causing a
refcnt leak.
Fix this issue by calling put_mapping() when gasket_dev is NULL.
Signed-off-by: Xiyu Yang <[email protected]>
Signed-off-by: Xin Tan <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python/bin')
0 files changed, 0 insertions, 0 deletions