[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <964c9987-ea86-4167-899d-3bd3442ebfdb@web.de>
Date: Mon, 22 Apr 2024 17:38:43 +0200
From: Markus Elfring <Markus.Elfring@....de>
To: Jose Fernandez <josef@...flix.com>, amd-gfx@...ts.freedesktop.org,
dri-devel@...ts.freedesktop.org, kernel-janitors@...r.kernel.org,
Alan Liu <haoping.liu@....com>, Alex Deucher <alexander.deucher@....com>,
Christian König <christian.koenig@....com>,
Daniel Vetter <daniel@...ll.ch>, David Airlie <airlied@...il.com>,
Fangzhi Zuo <jerry.zuo@....com>, George Shen <george.shen@....com>,
Hamza Mahfooz <hamza.mahfooz@....com>,
Harry Wentland <harry.wentland@....com>,
Ilya Bakoulin <ilya.bakoulin@....com>, Leo Li <sunpeng.li@....com>,
Leo Ma <hanghong.ma@....com>, Nasir Osman <nasir.osman@....com>,
Nicholas Kazlauskas <Nicholas.Kazlauskas@....com>,
Rodrigo Siqueira <Rodrigo.Siqueira@....com>,
Wenjing Liu <wenjing.liu@....com>, Xinhui Pan <Xinhui.Pan@....com>
Cc: LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] drm/amd/display: Fix division by zero in setup_dsc_config
…
> +++ b/drivers/gpu/drm/amd/display/dc/dsc/dc_dsc.c
> @@ -1055,7 +1055,12 @@ static bool setup_dsc_config(
> if (!is_dsc_possible)
> goto done;
>
> - dsc_cfg->num_slices_v = pic_height/slice_height;
> + if (slice_height > 0)
> + dsc_cfg->num_slices_v = pic_height/slice_height;
> + else {
> + is_dsc_possible = false;
> + goto done;
> + }
>
> if (target_bandwidth_kbps > 0) {
> is_dsc_possible = decide_dsc_target_bpp_x16(
I suggest to take another coding style concern into account.
Please use curly brackets for both if branches.
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/coding-style.rst?h=v6.9-rc5#n213
Regards,
Markus
Powered by blists - more mailing lists