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: <20080519055504.GB14902@lst.de>
Date:	Mon, 19 May 2008 07:55:04 +0200
From:	Christoph Hellwig <hch@....de>
To:	Marcin Slusarz <marcin.slusarz@...il.com>
Cc:	LKML <linux-kernel@...r.kernel.org>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Al Viro <viro@...IV.linux.org.uk>,
	Christoph Hellwig <hch@....de>
Subject: Re: [PATCH 2/6] ERR_PTR: add ERR_OR_0_PTR

On Mon, May 19, 2008 at 12:01:07AM +0200, Marcin Slusarz wrote:
> Some codepaths call ERR_PTR with possibly 0 argument, which is not
> a valid errno and rely on conversion from 0 to NULL pointer.
> Add ERR_OR_0_PTR function which accepts errnos and 0 as an argument.

Sorry, no.  ERR_PTR(0) is perfectly valid, you just don't want to return
the actualy value.  E.g. we have a common idiom of:

	some_ptr = ERR_PTR(err);
	if (IS_ERR(some_ptr))
		goto out_handle_err;

and obsfucating this with new syntactic sugar is not a good idea.

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