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  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Mon, 13 Oct 2014 00:51:19 +0200
From:	Josh Triplett <josh@...htriplett.org>
To:	Al Viro <viro@...IV.linux.org.uk>
Cc:	Eric Biggers <ebiggers3@...il.com>, linux-fsdevel@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/5] fs/anon_inodes.c: Simplify control flow in
 anon_inode_getfd()

On Sun, Oct 12, 2014 at 10:07:13PM +0100, Al Viro wrote:
> On Sun, Oct 12, 2014 at 03:42:39PM -0500, Eric Biggers wrote:
> >  	file = anon_inode_getfile(name, fops, priv, flags);
> >  	if (IS_ERR(file)) {
> > -		error = PTR_ERR(file);
> > -		goto err_put_unused_fd;
> > +		put_unused_fd(fd);
> > +		return PTR_ERR(file);
> >  	}
> >  	fd_install(fd, file);
> 
> at least slap unlikely() on that if (IS_ERR(...))...

That shouldn't be necessary, as far as I can tell; linux/err.h has:

#define IS_ERR_VALUE(x) unlikely((x) >= (unsigned long)-MAX_ERRNO)
...
static inline bool __must_check IS_ERR(__force const void *ptr)
{
	return IS_ERR_VALUE((unsigned long)ptr);
}

So unless GCC fails to propagate expected-value handling through static
inline functions, you should never need to write unlikely(IS_ERR(...)).

- Josh Triplett
--
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