OSDN Git Service

drm/amd/display: fail instead of div by zero/bugcheck
authorAshley Thomas <Ashley.Thomas2@amd.com>
Tue, 13 Oct 2020 04:33:27 +0000 (21:33 -0700)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 2 Nov 2020 20:30:47 +0000 (15:30 -0500)
commit7dd4f4df99109b280cd996602d7533cc0b2e7348
tree1fe522fdc441e2f4e86faec6414d796b10e7c00b
parent81e8da715ca7d837802dee48625f380c9a1dbd11
drm/amd/display: fail instead of div by zero/bugcheck

[why]
If pbn_per_slot is 0, fail instead of dividing by zero and
bugchecking.

[how]
Check for zero divisor before division operation.

Signed-off-by: Ashley Thomas <Ashley.Thomas2@amd.com>
Reviewed-by: Wyatt Wood <Wyatt.Wood@amd.com>
Acked-by: Qingqing Zhuo <qingqing.zhuo@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/core/dc_debug.c
drivers/gpu/drm/amd/display/dc/core/dc_link.c
drivers/gpu/drm/amd/display/dc/inc/core_status.h