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]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux