lkml.org 
[lkml]   [2008]   [May]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 4/6] procfs: switch ERR_PTR to ERR_OR_0_PTR when "error" might be 0
    Date
    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@gmail.com>
    Cc: Andrew Morton <akpm@linux-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


    \
     
     \ /
      Last update: 2008-05-19 00:07    [W:0.025 / U:0.468 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site