]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commit
mfd: pcf50633-adc: Fix potential memleak in pcf50633_adc_async_read()
authorQiheng Lin <linqiheng@huawei.com>
Thu, 8 Dec 2022 06:15:55 +0000 (14:15 +0800)
committerAndrea Righi <andrea.righi@canonical.com>
Tue, 14 Mar 2023 15:46:51 +0000 (16:46 +0100)
commit18b79716c3424bac80e7474f0c3e802d0d6a2f02
tree3d11ee50c1acdafc7cea3aaa581c18a84a9a6c84
parente40f6ee34e128666849530076013769633cc48c0
mfd: pcf50633-adc: Fix potential memleak in pcf50633_adc_async_read()

BugLink: https://bugs.launchpad.net/bugs/2011425
[ Upstream commit 8b450dcff23aa254844492831a8e2b508a9d522d ]

`req` is allocated in pcf50633_adc_async_read(), but
adc_enqueue_request() could fail to insert the `req` into queue.
We need to check the return value and free it in the case of failure.

Fixes: 08c3e06a5eb2 ("mfd: PCF50633 adc driver")
Signed-off-by: Qiheng Lin <linqiheng@huawei.com>
Signed-off-by: Lee Jones <lee@kernel.org>
Link: https://lore.kernel.org/r/20221208061555.8776-1-linqiheng@huawei.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
drivers/mfd/pcf50633-adc.c