]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
drm/amd/display: Skip wbscl_set_scaler_filter if filter is null
authorAlex Hung <alex.hung@amd.com>
Mon, 3 Jun 2024 16:47:37 +0000 (10:47 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 12 Sep 2024 09:06:41 +0000 (11:06 +0200)
[ Upstream commit c4d31653c03b90e51515b1380115d1aedad925dd ]

Callers can pass null in filter (i.e. from returned from the function
wbscl_get_filter_coeffs_16p) and a null check is added to ensure that is
not the case.

This fixes 4 NULL_RETURNS issues reported by Coverity.

Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Acked-by: Hamza Mahfooz <hamza.mahfooz@amd.com>
Signed-off-by: Alex Hung <alex.hung@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_dwb_scl.c

index 880954ac0b02748e58e2b3548adf0d880f74f22c..1b3cba5b1d74934232a67a746896d7ba37ecf3b7 100644 (file)
@@ -690,6 +690,9 @@ static void wbscl_set_scaler_filter(
        int pair;
        uint16_t odd_coef, even_coef;
 
+       if (!filter)
+               return;
+
        for (phase = 0; phase < (NUM_PHASES / 2 + 1); phase++) {
                for (pair = 0; pair < tap_pairs; pair++) {
                        even_coef = filter[phase * taps + 2 * pair];