[PATCH 4/6] procfs: switch ERR_PTR to ERR_OR_0_PTR when "error" might be 0

From: Marcin Slusarz
Date: Sun May 18 2008 - 18:04:04 EST


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@xxxxxxxxx>
Cc: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---
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@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/