From: Lv Ruyi Date: Wed, 24 Nov 2021 03:04:26 +0000 (+0000) Subject: drm/amd/display: fix application of sizeof to pointer X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=b7e7e6ca1f7b5abc9a4d13c9e929e431240d9f48;p=linux.git drm/amd/display: fix application of sizeof to pointer Both of split and merge are pointers, not arrays. Reviewed-by: Rodrigo Siqueira Reported-by: Zeal Robot Signed-off-by: Lv Ruyi Signed-off-by: Alex Deucher --- diff --git a/drivers/gpu/drm/amd/display/dc/dml/dml_wrapper.c b/drivers/gpu/drm/amd/display/dc/dml/dml_wrapper.c index ece34b0b8a46a..91810aaee5a33 100644 --- a/drivers/gpu/drm/amd/display/dc/dml/dml_wrapper.c +++ b/drivers/gpu/drm/amd/display/dc/dml/dml_wrapper.c @@ -1223,8 +1223,8 @@ static void dml_full_validate_bw_helper(struct dc *dc, *pipe_cnt = dml_populate_dml_pipes_from_context(dc, context, pipes, false); *vlevel = dml_get_voltage_level(&context->bw_ctx.dml, pipes, *pipe_cnt); if (*vlevel < context->bw_ctx.dml.soc.num_states) { - memset(split, 0, sizeof(split)); - memset(merge, 0, sizeof(merge)); + memset(split, 0, MAX_PIPES * sizeof(*split)); + memset(merge, 0, MAX_PIPES * sizeof(*merge)); *vlevel = dml_validate_apply_pipe_split_flags(dc, context, *vlevel, split, merge); }