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: <20160125150432.79297280@recife.lan>
Date:	Mon, 25 Jan 2016 15:04:32 -0200
From:	Mauro Carvalho Chehab <mchehab@....samsung.com>
To:	SF Markus Elfring <elfring@...rs.sourceforge.net>
Cc:	linux-media@...r.kernel.org, LKML <linux-kernel@...r.kernel.org>,
	kernel-janitors@...r.kernel.org,
	Julia Lawall <julia.lawall@...6.fr>
Subject: Re: [PATCH 2/2] [media] r820t: Better exception handling in
 generic_set_freq()

Em Mon, 28 Dec 2015 17:32:22 +0100
SF Markus Elfring <elfring@...rs.sourceforge.net> escreveu:

> From: Markus Elfring <elfring@...rs.sourceforge.net>
> Date: Mon, 28 Dec 2015 17:13:02 +0100
> 
> This issue was detected by using the Coccinelle software.
> 
> Move the jump label directly before the desired log statement
> so that the variable "rc" will not be checked once more
> after a function call.
> Use the identifier "report_failure" instead of "err".
> 
> The error logging is performed in a separate section at the end now.
> 
> Signed-off-by: Markus Elfring <elfring@...rs.sourceforge.net>
> ---
>  drivers/media/tuners/r820t.c | 16 +++++++---------
>  1 file changed, 7 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/media/tuners/r820t.c b/drivers/media/tuners/r820t.c
> index 6ab35e3..f71642e 100644
> --- a/drivers/media/tuners/r820t.c
> +++ b/drivers/media/tuners/r820t.c
> @@ -1303,7 +1303,7 @@ static int generic_set_freq(struct dvb_frontend *fe,
>  
>  	rc = r820t_set_tv_standard(priv, bw, type, std, delsys);
>  	if (rc < 0)
> -		goto err;
> +		goto report_failure;

Same thing as my previous comment: just "err" please.

Same applies to other patches you sent with similar hunks.

>  
>  	if ((type == V4L2_TUNER_ANALOG_TV) && (std == V4L2_STD_SECAM_LC))
>  		lo_freq = freq - priv->int_freq;
> @@ -1312,23 +1312,21 @@ static int generic_set_freq(struct dvb_frontend *fe,
>  
>  	rc = r820t_set_mux(priv, lo_freq);
>  	if (rc < 0)
> -		goto err;
> +		goto report_failure;
>  
>  	rc = r820t_set_pll(priv, type, lo_freq);
>  	if (rc < 0 || !priv->has_lock)
> -		goto err;
> +		goto report_failure;
>  
>  	rc = r820t_sysfreq_sel(priv, freq, type, std, delsys);
>  	if (rc < 0)
> -		goto err;
> +		goto report_failure;
>  
>  	tuner_dbg("%s: PLL locked on frequency %d Hz, gain=%d\n",
>  		  __func__, freq, r820t_read_gain(priv));
> -
> -err:
> -
> -	if (rc < 0)
> -		tuner_dbg("%s: failed=%d\n", __func__, rc);
> +	return 0;
> +report_failure:
> +	tuner_dbg("%s: failed=%d\n", __func__, rc);
>  	return rc;
>  }
>  

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ