]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
sysfs: checking for NULL instead of ERR_PTR
authorDan Carpenter <error27@gmail.com>
Wed, 25 Aug 2010 07:12:29 +0000 (09:12 +0200)
committerPaul Gortmaker <paul.gortmaker@windriver.com>
Thu, 6 Jan 2011 23:07:44 +0000 (18:07 -0500)
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>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
fs/sysfs/file.c

index e222b25827461385fb780091956a61cb95c0330e..0831b8838498ce558a8bc46db7ff0bc3b83c2cd5 100644 (file)
@@ -340,7 +340,7 @@ static int sysfs_open_file(struct inode *inode, struct file *file)
        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 */