]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
media: rc: st_rc: Fix reset control resource leak
authorHaotian Zhang <vulab@iscas.ac.cn>
Fri, 31 Oct 2025 06:03:32 +0000 (14:03 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 19 Jan 2026 12:10:01 +0000 (13:10 +0100)
commit76bbb99a030f27fb548e01c7eeddd2c1f9ca02b8
tree7baa59a0c9ed086602150df0ae407f0a6ca09d1e
parentf69506115f619e187d8a5f3f57b8a62296cc553c
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>
drivers/media/rc/st_rc.c