lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 7 Jul 2020 18:48:07 +0000
From:   Tomasz Figa <tfiga@...omium.org>
To:     Jonathan Bakker <xc-racer2@...e.ca>
Cc:     kyungmin.park@...sung.com, s.nawrocki@...sung.com,
        mchehab@...nel.org, kgene@...nel.org, krzk@...nel.org,
        linux-media@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
        linux-samsung-soc@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 11/11] media: exynos4-is: Correct parallel port probing

Hi Jonathan,

On Sat, Apr 25, 2020 at 07:26:50PM -0700, Jonathan Bakker wrote:
> According to the binding doc[1], port A should be reg = 0
> and port B reg = 1.  Unfortunately, the driver was treating 0
> as invalid and 1 as camera port A.  Match the binding doc and
> make 0=A and 1=B.
> 
> [1] Documentation/devicetree/bindings/media/samsung-fimc.txt
> 
> Signed-off-by: Jonathan Bakker <xc-racer2@...e.ca>
> ---
>  drivers/media/platform/exynos4-is/media-dev.c | 18 +++++++++++++-----
>  drivers/media/platform/exynos4-is/media-dev.h |  1 +
>  include/media/drv-intf/exynos-fimc.h          |  2 +-
>  3 files changed, 15 insertions(+), 6 deletions(-)
> 

Thank you for the patch. Please see my comments inline.

> diff --git a/drivers/media/platform/exynos4-is/media-dev.c b/drivers/media/platform/exynos4-is/media-dev.c
> index a87ebd7913be..9c4fdf726b92 100644
> --- a/drivers/media/platform/exynos4-is/media-dev.c
> +++ b/drivers/media/platform/exynos4-is/media-dev.c
> @@ -418,13 +418,21 @@ static int fimc_md_parse_port_node(struct fimc_md *fmd,
>  		return ret;
>  	}
>  
> -	if (WARN_ON(endpoint.base.port == 0) || *index >= FIMC_MAX_SENSORS) {
> -		of_node_put(ep);
> -		return -EINVAL;
> +	if (fimc_input_is_parallel(endpoint.base.port)) {
> +		if (WARN_ON(*index >= FIMC_MAX_PARALLEL)) {
> +			of_node_put(ep);
> +			return -EINVAL;
> +		}

This check seems to be generic, so could we just move it above the
if/else block?

> +		pd->mux_id = endpoint.base.port;
> +	} else {
> +		if (WARN_ON(endpoint.base.port == 0 ||

Isn't this impossible, since if port == 0, the 'then' branch would've been
taken instead?

Best regards,
Tomasz

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ