Patch "drm/amd/display: fix a divided-by-zero error" has been added to the 6.2-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    drm/amd/display: fix a divided-by-zero error

to the 6.2-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     drm-amd-display-fix-a-divided-by-zero-error.patch
and it can be found in the queue-6.2 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 358f521f8c54b3d5118288121ab08dc5bc20af35
Author: Alex Hung <alex.hung@xxxxxxx>
Date:   Mon Apr 3 17:45:41 2023 +0800

    drm/amd/display: fix a divided-by-zero error
    
    [ Upstream commit 0b5dfe12755f87ec014bb4cc1930485026167430 ]
    
    [Why & How]
    
    timing.dsc_cfg.num_slices_v can be zero and it is necessary to check
    before using it.
    
    This fixes the error "divide error: 0000 [#1] PREEMPT SMP NOPTI".
    
    Reviewed-by: Aurabindo Pillai <Aurabindo.Pillai@xxxxxxx>
    Acked-by: Qingqing Zhuo <qingqing.zhuo@xxxxxxx>
    Signed-off-by: Alex Hung <alex.hung@xxxxxxx>
    Tested-by: Daniel Wheeler <daniel.wheeler@xxxxxxx>
    Signed-off-by: Alex Deucher <alexander.deucher@xxxxxxx>
    Cc: stable@xxxxxxxxxxxxxxx
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/gpu/drm/amd/display/modules/power/power_helpers.c b/drivers/gpu/drm/amd/display/modules/power/power_helpers.c
index cf4fa87c7db60..e75b443ee95dc 100644
--- a/drivers/gpu/drm/amd/display/modules/power/power_helpers.c
+++ b/drivers/gpu/drm/amd/display/modules/power/power_helpers.c
@@ -933,6 +933,10 @@ bool psr_su_set_y_granularity(struct dc *dc, struct dc_link *link,
 
 	pic_height = stream->timing.v_addressable +
 		stream->timing.v_border_top + stream->timing.v_border_bottom;
+
+	if (stream->timing.dsc_cfg.num_slices_v == 0)
+		return false;
+
 	slice_height = pic_height / stream->timing.dsc_cfg.num_slices_v;
 
 	if (slice_height) {



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux