summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/sun4i
diff options
context:
space:
mode:
authorWentao Liang <vulab@iscas.ac.cn>2026-06-07 03:09:50 +0000
committerChen-Yu Tsai <wens@kernel.org>2026-07-07 01:22:29 +0800
commitf7a56ff6240e6fd0cb36a3c0a911a1cd54789ce2 (patch)
tree1da03009fd3ad6a33f705a2489a07db498583042 /drivers/gpu/drm/sun4i
parent34d85c43b6cb3abec03d6f9d8128fb28a7e2bfdf (diff)
downloadlinux-next-f7a56ff6240e6fd0cb36a3c0a911a1cd54789ce2.tar.gz
linux-next-f7a56ff6240e6fd0cb36a3c0a911a1cd54789ce2.zip
drm/sun4i: fix refcount leak in sun4i_backend_init_sat()
When sun4i_backend_init_sat() calls reset_control_deassert() it increments the deassert_count of the reset controller, and must pair that with a reset_control_assert() call to decrement it. In the error path where clk_prepare_enable() fails, the function returns immediately without calling reset_control_assert(), leaking the reference count. Other error paths, like the devm_clk_get() failure, correctly jump to the err_assert_reset label which performs the missing assert. Fix the leak by using the existing err_assert_reset label in the clk_prepare_enable error path instead of returning directly. Cc: stable@vger.kernel.org Fixes: 440d2c7b127a ("drm/sun4i: backend: Handle the SAT") Signed-off-by: Wentao Liang <vulab@iscas.ac.cn> Reviewed-by: Jernej Skrabec <jernej.skrabec@gmail.com> Link: https://patch.msgid.link/20260607030950.83636-1-vulab@iscas.ac.cn Signed-off-by: Chen-Yu Tsai <wens@kernel.org>
Diffstat (limited to 'drivers/gpu/drm/sun4i')
-rw-r--r--drivers/gpu/drm/sun4i/sun4i_backend.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/drm/sun4i/sun4i_backend.c b/drivers/gpu/drm/sun4i/sun4i_backend.c
index 03e46a2af646..adf5b6e09ca6 100644
--- a/drivers/gpu/drm/sun4i/sun4i_backend.c
+++ b/drivers/gpu/drm/sun4i/sun4i_backend.c
@@ -686,7 +686,7 @@ static int sun4i_backend_init_sat(struct device *dev) {
ret = clk_prepare_enable(backend->sat_clk);
if (ret) {
dev_err(dev, "Couldn't enable the SAT clock\n");
- return ret;
+ goto err_assert_reset;
}
return 0;