mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-02 15:18:19 +00:00
drm/amd/display: Set initial value to a divider
[why/how] Due to compiler optimization the values would be passed to the division function uninitialized causing a div by zero. Initialize the numerator and denominator to 0 and 1 to prevent division by zero. Signed-off-by: Mikita Lipski <mikita.lipski@amd.com> Acked-by: Qingqing Zhuo <qingqing.zhuo@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
parent
712343cd21
commit
8532467cc9
1 changed files with 2 additions and 2 deletions
|
@ -2891,8 +2891,8 @@ static struct fixed31_32 get_pbn_per_slot(struct dc_stream_state *stream)
|
|||
static struct fixed31_32 get_pbn_from_bw_in_kbps(uint64_t kbps)
|
||||
{
|
||||
struct fixed31_32 peak_kbps;
|
||||
uint32_t numerator;
|
||||
uint32_t denominator;
|
||||
uint32_t numerator = 0;
|
||||
uint32_t denominator = 1;
|
||||
|
||||
/*
|
||||
* margin 5300ppm + 300ppm ~ 0.6% as per spec, factor is 1.006
|
||||
|
|
Loading…
Reference in a new issue