Commit 315ce6c4 authored by Ethan Carter Edwards's avatar Ethan Carter Edwards Committed by Alex Deucher
Browse files

drm/amd/display: change kzalloc to kcalloc in dml1_validate()



We are trying to get rid of all multiplications from allocation
functions to prevent integer overflows. Here the multiplication is
probably safe, but using kcalloc() is more appropriate and improves
readability. This patch has no effect on runtime behavior.

Reviewed-by: default avatarRodrigo Siqueira <siqueira@igalia.com>
Reviewed-by: default avatarAlex Hung <alex.hung@amd.com>
Signed-off-by: default avatarEthan Carter Edwards <ethan@ethancedwards.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent b17a94f2
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -1749,7 +1749,8 @@ static bool dml1_validate(struct dc *dc, struct dc_state *context, bool fast_val

	int vlevel = 0;
	int pipe_cnt = 0;
	display_e2e_pipe_params_st *pipes = kzalloc(dc->res_pool->pipe_count * sizeof(display_e2e_pipe_params_st), GFP_KERNEL);
	display_e2e_pipe_params_st *pipes = kcalloc(dc->res_pool->pipe_count,
			sizeof(display_e2e_pipe_params_st), GFP_KERNEL);

	/* To handle Freesync properly, setting FreeSync DML parameters
	 * to its default state for the first stage of validation