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]
Message-ID: <YaE5Uz0+dEtG7gaN@archlinux-ax161>
Date:   Fri, 26 Nov 2021 12:45:23 -0700
From:   Nathan Chancellor <nathan@...nel.org>
To:     Mauro Carvalho Chehab <mchehab+huawei@...nel.org>
Cc:     linuxarm@...wei.com, mauro.chehab@...wei.com,
        Mauro Carvalho Chehab <mchehab@...nel.org>,
        linux-kernel@...r.kernel.org, linux-media@...r.kernel.org
Subject: Re: [PATCH 07/20] media: si21xx: report eventual errors at
 set_frontend

On Wed, Nov 24, 2021 at 08:13:10PM +0100, Mauro Carvalho Chehab wrote:
> If an error occurs while setting the registers at set_frontend,
> it is silently ignored. Yet, the variable status is updated.
> 
> Change the logic to return an error if it fails to write values
> to the registers.
> 
> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@...nel.org>

I am not super familiar with the different return codes so I assume it
is appropriate (the sites that I see calling set_frontend() appears to
only check for a negative return code).

Reviewed-by: Nathan Chancellor <nathan@...nel.org>

> ---
> 
> To avoid mailbombing on a large number of people, only mailing lists were C/C on the cover.
> See [PATCH 00/20] at: https://lore.kernel.org/all/cover.1637781097.git.mchehab+huawei@kernel.org/
> 
>  drivers/media/dvb-frontends/si21xx.c | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/media/dvb-frontends/si21xx.c b/drivers/media/dvb-frontends/si21xx.c
> index e31eb2c5cc4c..001b23588389 100644
> --- a/drivers/media/dvb-frontends/si21xx.c
> +++ b/drivers/media/dvb-frontends/si21xx.c
> @@ -711,7 +711,7 @@ static int si21xx_set_frontend(struct dvb_frontend *fe)
>  	int i;
>  	bool inband_interferer_div2[ALLOWABLE_FS_COUNT];
>  	bool inband_interferer_div4[ALLOWABLE_FS_COUNT];
> -	int status;
> +	int status = 0;
>  
>  	/* allowable sample rates for ADC in MHz */
>  	int afs[ALLOWABLE_FS_COUNT] = { 200, 192, 193, 194, 195,
> @@ -747,8 +747,6 @@ static int si21xx_set_frontend(struct dvb_frontend *fe)
>  	rf_freq = 10 * c->frequency ;
>  	data_rate = c->symbol_rate / 100;
>  
> -	status = PASS;
> -
>  	band_low = (rf_freq - lnb_lo) - ((lnb_uncertanity * 200)
>  					+ (data_rate * 135)) / 200;
>  
> @@ -832,6 +830,9 @@ static int si21xx_set_frontend(struct dvb_frontend *fe)
>  	state->fs = sample_rate;/*ADC MHz*/
>  	si21xx_setacquire(fe, c->symbol_rate, c->fec_inner);
>  
> +	if (status)
> +		return -EREMOTEIO;
> +
>  	return 0;
>  }
>  
> -- 
> 2.33.1
> 
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ