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: <53183D58.4040507@mev.co.uk>
Date:	Thu, 6 Mar 2014 09:18:16 +0000
From:	Ian Abbott <abbotti@....co.uk>
To:	Fred Akers <knivey@...ops.net>
CC:	"greg@...ah.com" <greg@...ah.com>,
	Ian Abbott <ian.abbott@....co.uk>,
	"hsweeten@...ionengravers.com" <hsweeten@...ionengravers.com>,
	"devel@...verdev.osuosl.org" <devel@...verdev.osuosl.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2 2/2] Staging: comedi: range: remove unnecessary sanity
 check

On 06/03/14 06:57, Fred Akers wrote:
> This check is unnecessary because range_table will always be
> initialized to range_unknown by comedi_device_postconfig() for
> drivers that do not initialize range_table or range_table_list
>
> Signed-off-by: Fred Akers <knivey@...ops.net>
> ---
>   drivers/staging/comedi/range.c | 4 ----
>   1 file changed, 4 deletions(-)
>
> diff --git a/drivers/staging/comedi/range.c b/drivers/staging/comedi/range.c
> index c4bb13b..b684954 100644
> --- a/drivers/staging/comedi/range.c
> +++ b/drivers/staging/comedi/range.c
> @@ -143,10 +143,6 @@ int comedi_check_chanlist(struct comedi_subdevice *s, int n,
>   	unsigned int chanspec;
>   	int chan, range_len, i;
>
> -	if (!s->range_table && !s->range_table_list) {
> -		dev_err(dev->class_dev, "(bug) no range type list!\n");
> -		return -EINVAL;
> -	}
>   	for (i = 0; i < n; i++) {
>   		chanspec = chanlist[i];
>   		chan = CR_CHAN(chanspec);
>

Reviewed-by: Ian Abbott <abbotti@....co.uk>

(Further down this `for` loop, the NULL-ness test on 
`s->range_table_list` is also technically redundant, but I think the 
code is clearer with the check left in, and is safer in a defensive way.)

-- 
-=( Ian Abbott @ MEV Ltd.    E-mail: <abbotti@....co.uk>        )=-
-=( Tel: +44 (0)161 477 1898   FAX: +44 (0)161 718 3587         )=-
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ