diff options
author | Qiushi Wu <wu000273@umn.edu> | 2020-05-02 18:33:38 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-06-22 09:33:03 +0200 |
commit | 86e6fdb9a447583b6b01894b23fa413a4de90da2 (patch) | |
tree | 50e3eefde1a80add11785be28586a6118b547ef9 /tools/perf/scripts/python/export-to-postgresql.py | |
parent | aa354751988082fae2df8ae1706c09df68f5940d (diff) |
power: supply: core: fix memory leak in HWMON error path
commit 1d7a7128a2e9e1f137c99b0a44e94d70a77343e3 upstream.
In function power_supply_add_hwmon_sysfs(), psyhw->props is
allocated by bitmap_zalloc(). But this pointer is not deallocated
when devm_add_action fail, which lead to a memory leak bug. To fix
this, we replace devm_add_action with devm_add_action_or_reset.
Cc: stable@kernel.org
Fixes: e67d4dfc9ff19 ("power: supply: Add HWMON compatibility layer")
Signed-off-by: Qiushi Wu <wu000273@umn.edu>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
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