summaryrefslogtreecommitdiff
path: root/drivers/media
diff options
context:
space:
mode:
authorHaotian Zhang <vulab@iscas.ac.cn>2025-10-31 14:03:32 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2026-01-08 10:16:59 +0100
commite9918c6a0044b9e224bc8b1ceb6d7d956b3f4cab (patch)
tree7360a6e070a2d60e57d7db4f5338e3327385de0c /drivers/media
parent10eecb592afc854683366a8936accf43a197052c (diff)
downloadlinux-e9918c6a0044b9e224bc8b1ceb6d7d956b3f4cab.tar.gz
linux-e9918c6a0044b9e224bc8b1ceb6d7d956b3f4cab.tar.bz2
linux-e9918c6a0044b9e224bc8b1ceb6d7d956b3f4cab.zip
media: rc: st_rc: Fix reset control resource leak
commit 1240abf4b71f632f0117b056e22488e4d9808938 upstream. The driver calls reset_control_get_optional_exclusive() but never calls reset_control_put() in error paths or in the remove function. This causes a resource leak when probe fails after successfully acquiring the reset control, or when the driver is unloaded. Switch to devm_reset_control_get_optional_exclusive() to automatically manage the reset control resource. Fixes: a4b80242d046 ("media: st-rc: explicitly request exclusive reset control") Cc: stable@vger.kernel.org Signed-off-by: Haotian Zhang <vulab@iscas.ac.cn> Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com> Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/rc/st_rc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/media/rc/st_rc.c b/drivers/media/rc/st_rc.c
index 6539fa0a6e79..6b70bac5f45d 100644
--- a/drivers/media/rc/st_rc.c
+++ b/drivers/media/rc/st_rc.c
@@ -284,7 +284,7 @@ static int st_rc_probe(struct platform_device *pdev)
else
rc_dev->rx_base = rc_dev->base;
- rc_dev->rstc = reset_control_get_optional_exclusive(dev, NULL);
+ rc_dev->rstc = devm_reset_control_get_optional_exclusive(dev, NULL);
if (IS_ERR(rc_dev->rstc)) {
ret = PTR_ERR(rc_dev->rstc);
goto err;