mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-04-02 09:21:19 -04:00
drm/amd/display: Check NULL before accessing a variable
[WHAT] Check NULL before accessing link, not after. This is reported as a REVERSE_INULL error by Coverity. Reviewed-by: Aurabindo Pillai <aurabindo.pillai@amd.com> Signed-off-by: Alex Hung <alex.hung@amd.com> Signed-off-by: Matthew Stewart <matthew.stewart2@amd.com> Tested-by: Dan Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
@@ -984,10 +984,13 @@ void set_replay_frame_skip_number(struct dc_link *link,
|
||||
uint32_t *frame_skip_number_array = NULL;
|
||||
uint32_t frame_skip_number = 0;
|
||||
|
||||
if (link == NULL)
|
||||
return;
|
||||
|
||||
if (false == link->replay_settings.config.frame_skip_supported)
|
||||
return;
|
||||
|
||||
if (link == NULL || flicker_free_refresh_rate_mhz == 0 || coasting_vtotal_refresh_rate_mhz == 0)
|
||||
if (flicker_free_refresh_rate_mhz == 0 || coasting_vtotal_refresh_rate_mhz == 0)
|
||||
return;
|
||||
|
||||
if (is_defer)
|
||||
|
||||
Reference in New Issue
Block a user