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: <1211148194-16187-1-git-send-email-marcin.slusarz@gmail.com>
Date:	Mon, 19 May 2008 00:03:14 +0200
From:	Marcin Slusarz <marcin.slusarz@...il.com>
To:	LKML <linux-kernel@...r.kernel.org>
Cc:	Andrew Morton <akpm@...ux-foundation.org>,
	Al Viro <viro@...IV.linux.org.uk>,
	Christoph Hellwig <hch@....de>
Subject: [PATCH 4/6] procfs: switch ERR_PTR to ERR_OR_0_PTR when "error" might be 0

proc_pid_follow_link and proc_self_follow_link call ERR_PTR with 0 argument
(invalid errno) in most of situtations.
Replace ERR_PTR calls with ERR_OR_0_PTR which accepts 0 argument.

Signed-off-by: Marcin Slusarz <marcin.slusarz@...il.com>
Cc: Andrew Morton <akpm@...ux-foundation.org>
---
 fs/proc/base.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/proc/base.c b/fs/proc/base.c
index 808cbdc..ebbb8e6 100644
--- a/fs/proc/base.c
+++ b/fs/proc/base.c
@@ -1292,7 +1292,7 @@ static void *proc_pid_follow_link(struct dentry *dentry, struct nameidata *nd)
 	error = PROC_I(inode)->op.proc_get_link(inode, &nd->path);
 	nd->last_type = LAST_BIND;
 out:
-	return ERR_PTR(error);
+	return ERR_OR_0_PTR(error);
 }
 
 static int do_proc_readlink(struct path *path, char __user *buffer, int buflen)
@@ -2228,7 +2228,7 @@ static void *proc_self_follow_link(struct dentry *dentry, struct nameidata *nd)
 	if (!tgid)
 		return ERR_PTR(-ENOENT);
 	sprintf(tmp, "%d", task_tgid_nr_ns(current, ns));
-	return ERR_PTR(vfs_follow_link(nd,tmp));
+	return ERR_OR_0_PTR(vfs_follow_link(nd,tmp));
 }
 
 static const struct inode_operations proc_self_inode_operations = {
-- 
1.5.4.5

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