Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/tegra: rgb: Fix missing clk_put() in the error handling paths of tegra_dc_rgb_probe()

If clk_get_sys(..., "pll_d2_out0") fails, the clk_get_sys() call must be
undone.

Add the missing clk_put and a new 'put_pll_d_out0' label in the error
handling path, and use it.

Fixes: 0c921b6d4ba0 ("drm/tegra: dc: rgb: Allow changing PLLD rate on Tegra30+")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Thierry Reding <treding@nvidia.com>
Link: https://patchwork.freedesktop.org/patch/msgid/0182895ead4e4730426616b0d9995954c960b634.1693667005.git.christophe.jaillet@wanadoo.fr

authored by

Christophe JAILLET and committed by
Thierry Reding
45c8034d bc456b5d

+3 -1
+3 -1
drivers/gpu/drm/tegra/rgb.c
··· 254 254 if (IS_ERR(rgb->pll_d2_out0)) { 255 255 err = PTR_ERR(rgb->pll_d2_out0); 256 256 dev_err(dc->dev, "failed to get pll_d2_out0: %d\n", err); 257 - goto remove; 257 + goto put_pll; 258 258 } 259 259 } 260 260 ··· 262 262 263 263 return 0; 264 264 265 + put_pll: 266 + clk_put(rgb->pll_d_out0); 265 267 remove: 266 268 tegra_output_remove(&rgb->output); 267 269 return err;