]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
drm/amd/display: Pass non-null to dcn20_validate_apply_pipe_split_flags
authorAlex Hung <alex.hung@amd.com>
Thu, 27 Jun 2024 17:51:27 +0000 (11:51 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 10 Oct 2024 10:00:28 +0000 (12:00 +0200)
[ Upstream commit 5559598742fb4538e4c51c48ef70563c49c2af23 ]

[WHAT & HOW]
"dcn20_validate_apply_pipe_split_flags" dereferences merge, and thus it
cannot be a null pointer. Let's pass a valid pointer to avoid null
dereference.

This fixes 2 FORWARD_NULL issues reported by Coverity.

Reviewed-by: Rodrigo Siqueira <rodrigo.siqueira@amd.com>
Signed-off-by: Jerry Zuo <jerry.zuo@amd.com>
Signed-off-by: Alex Hung <alex.hung@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>
drivers/gpu/drm/amd/display/dc/resource/dcn20/dcn20_resource.c
drivers/gpu/drm/amd/display/dc/resource/dcn21/dcn21_resource.c

index 6b380e037e3f8bfdffe6c648dd0d2651ee08c264..c0d1b41eb90042033d6d860547800b832abdb25d 100644 (file)
@@ -2033,6 +2033,7 @@ bool dcn20_fast_validate_bw(
 {
        bool out = false;
        int split[MAX_PIPES] = { 0 };
+       bool merge[MAX_PIPES] = { false };
        int pipe_cnt, i, pipe_idx, vlevel;
 
        ASSERT(pipes);
@@ -2057,7 +2058,7 @@ bool dcn20_fast_validate_bw(
        if (vlevel > context->bw_ctx.dml.soc.num_states)
                goto validate_fail;
 
-       vlevel = dcn20_validate_apply_pipe_split_flags(dc, context, vlevel, split, NULL);
+       vlevel = dcn20_validate_apply_pipe_split_flags(dc, context, vlevel, split, merge);
 
        /*initialize pipe_just_split_from to invalid idx*/
        for (i = 0; i < MAX_PIPES; i++)
index 8663cbc3d1cf5ea08ee923ad3b74383aed10ee78..347e6aaea582fb01ac790aa88b158d4de9120a9d 100644 (file)
@@ -774,6 +774,7 @@ bool dcn21_fast_validate_bw(struct dc *dc,
 {
        bool out = false;
        int split[MAX_PIPES] = { 0 };
+       bool merge[MAX_PIPES] = { false };
        int pipe_cnt, i, pipe_idx, vlevel;
 
        ASSERT(pipes);
@@ -816,7 +817,7 @@ bool dcn21_fast_validate_bw(struct dc *dc,
                        goto validate_fail;
        }
 
-       vlevel = dcn20_validate_apply_pipe_split_flags(dc, context, vlevel, split, NULL);
+       vlevel = dcn20_validate_apply_pipe_split_flags(dc, context, vlevel, split, merge);
 
        for (i = 0, pipe_idx = 0; i < dc->res_pool->pipe_count; i++) {
                struct pipe_ctx *pipe = &context->res_ctx.pipe_ctx[i];