mirror of
https://github.com/nxp-imx/linux-imx.git
synced 2025-07-06 17:35:20 +02:00
drm/amd/display: Check null pointers before using dc->clk_mgr
[ Upstream commit 95d9e0803e
]
[WHY & HOW]
dc->clk_mgr is null checked previously in the same function, indicating
it might be null.
Passing "dc" to "dc->hwss.apply_idle_power_optimizations", which
dereferences null "dc->clk_mgr". (The function pointer resolves to
"dcn35_apply_idle_power_optimizations".)
This fixes 1 FORWARD_NULL issue reported by Coverity.
Reviewed-by: Rodrigo Siqueira <rodrigo.siqueira@amd.com>
Signed-off-by: Alex Hung <alex.hung@amd.com>
Signed-off-by: Tom Chung <chiahsuan.chung@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
4778982c73
commit
9641bc4adf
|
@ -4716,7 +4716,8 @@ void dc_allow_idle_optimizations(struct dc *dc, bool allow)
|
|||
if (allow == dc->idle_optimizations_allowed)
|
||||
return;
|
||||
|
||||
if (dc->hwss.apply_idle_power_optimizations && dc->hwss.apply_idle_power_optimizations(dc, allow))
|
||||
if (dc->hwss.apply_idle_power_optimizations && dc->clk_mgr != NULL &&
|
||||
dc->hwss.apply_idle_power_optimizations(dc, allow))
|
||||
dc->idle_optimizations_allowed = allow;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user