Re: [PATCH] fs/compat: remove redundant 'less than zero' check

Dan Carpenter
2015-04-24T12:04:53Z

On Fri, Apr 24, 2015 at 06:07:50PM +0800, Firo Yang wrote:

> - if (nr_segs > UIO_MAXIOV || nr_segs < 0)
> + if (nr_segs > UIO_MAXIOV)

Linus said at kernel summit that he thinks this kind of checks are ok.

Smatch already ignores checks like:

if (nr_segs < 0 || nr_segs > UIO_MAXIOV)

So making it ignore this one as well shouldn't be hard... I'll change
Smatch to ignore this one as well.

regards,
dan carpenter