Commit 2a07eab
gpu: cdns-mhdp8546: fix call balance of mhdp->clk handling routines
[ Upstream commit f65727b ]
If the clock mhdp->clk was not enabled in cdns_mhdp_probe(), it should not
be disabled in any path.
The return value of clk_prepare_enable() is not checked. If mhdp->clk was
not enabled, it may be disabled in the error path of cdns_mhdp_probe()
(e.g., if cdns_mhdp_load_firmware() fails) or in cdns_mhdp_remove() after
a successful cdns_mhdp_probe() call.
Use the devm_clk_get_enabled() helper function to ensure proper call
balance for mhdp->clk.
Found by Linux Verification Center (linuxtesting.org) with Klever.
Fixes: fb43aa0 ("drm: bridge: Add support for Cadence MHDP8546 DPI/DP bridge")
Signed-off-by: Vitalii Mordan <mordan@ispras.ru>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Signed-off-by: Robert Foss <rfoss@kernel.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20250214154632.1907425-1-mordan@ispras.ru
Signed-off-by: Sasha Levin <sashal@kernel.org>1 parent d5eb8e3 commit 2a07eab
1 file changed
+3
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2463 | 2463 | | |
2464 | 2464 | | |
2465 | 2465 | | |
2466 | | - | |
| 2466 | + | |
2467 | 2467 | | |
2468 | | - | |
| 2468 | + | |
2469 | 2469 | | |
2470 | 2470 | | |
2471 | 2471 | | |
| |||
2504 | 2504 | | |
2505 | 2505 | | |
2506 | 2506 | | |
2507 | | - | |
2508 | | - | |
2509 | 2507 | | |
2510 | 2508 | | |
2511 | 2509 | | |
2512 | 2510 | | |
2513 | 2511 | | |
2514 | | - | |
| 2512 | + | |
2515 | 2513 | | |
2516 | 2514 | | |
2517 | 2515 | | |
| |||
2590 | 2588 | | |
2591 | 2589 | | |
2592 | 2590 | | |
2593 | | - | |
2594 | | - | |
2595 | 2591 | | |
2596 | 2592 | | |
2597 | 2593 | | |
| |||
2632 | 2628 | | |
2633 | 2629 | | |
2634 | 2630 | | |
2635 | | - | |
2636 | | - | |
2637 | 2631 | | |
2638 | 2632 | | |
2639 | 2633 | | |
| |||
0 commit comments