diff options
author | ruanjinjie | 2022-11-17 14:47:25 +0800 |
---|---|---|
committer | Greg Kroah-Hartman | 2022-12-31 13:32:40 +0100 |
commit | ef843ee20576039126d34d6eb5f45d14c3e6ce18 (patch) | |
tree | f87cd7f3f660397f90ef5bab2bdda3b6e1103c0f /drivers/pwm/pwm-lpss.c | |
parent | 40ff4c2335a98f0ee96b099bfd70b8e6644f321f (diff) |
misc: tifm: fix possible memory leak in tifm_7xx1_switch_media()
[ Upstream commit fd2c930cf6a5b9176382c15f9acb1996e76e25ad ]
If device_register() returns error in tifm_7xx1_switch_media(),
name of kobject which is allocated in dev_set_name() called in device_add()
is leaked.
Never directly free @dev after calling device_register(), even
if it returned an error! Always use put_device() to give up the
reference initialized.
Fixes: 2428a8fe2261 ("tifm: move common device management tasks from tifm_7xx1 to tifm_core")
Signed-off-by: ruanjinjie <ruanjinjie@huawei.com>
Link: https://lore.kernel.org/r/20221117064725.3478402-1-ruanjinjie@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/pwm/pwm-lpss.c')
0 files changed, 0 insertions, 0 deletions