lkml.org 
[lkml]   [2010]   [Sep]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    Subject[036/123] sysfs: checking for NULL instead of ERR_PTR
    From: Dan Carpenter <error27@gmail.com>

    commit 57f9bdac2510cd7fda58e4a111d250861eb1ebeb upstream.

    d_path() returns an ERR_PTR and it doesn't return NULL.

    Signed-off-by: Dan Carpenter <error27@gmail.com>
    Reviewed-by: "Eric W. Biederman" <ebiederm@xmission.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

    ---
    fs/sysfs/file.c | 2 +-
    1 file changed, 1 insertion(+), 1 deletion(-)

    --- a/fs/sysfs/file.c
    +++ b/fs/sysfs/file.c
    @@ -340,7 +340,7 @@ static int sysfs_open_file(struct inode
    char *p;

    p = d_path(&file->f_path, last_sysfs_file, sizeof(last_sysfs_file));
    - if (p)
    + if (!IS_ERR(p))
    memmove(last_sysfs_file, p, strlen(p) + 1);

    /* need attr_sd for attr and ops, its parent for kobj */



    \
     
     \ /
      Last update: 2010-09-18 21:07    [W:4.123 / U:0.120 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site