Re: [PATCH 5.10 527/717] media: ipu3-cio2: Validate mbus format in setting subdev format

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

 



Hi!

> commit a86cf9b29e8b12811cf53c4970eefe0c1d290476 upstream.
> 
> Validate media bus code, width and height when setting the subdev format.
> 
> This effectively reworks how setting subdev format is implemented in the
> driver.

Something is wrong here:

> +	fmt->format.code = formats[0].mbus_code;
> +	for (i = 0; i < ARRAY_SIZE(formats); i++) {
> +		if (formats[i].mbus_code == fmt->format.code) {
> +			fmt->format.code = mbus_code;
> +			break;
> +		}

This does not make sense. Loop will always exit during the first
iteration, making the whole loop crazy/redundant.

Best regards,
								Pavel

-- 
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux