Re: [PATCH] drm/amd/display: Fix division by zero in setup_dsc_config

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

 



…
> +++ 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




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux