aboutsummaryrefslogtreecommitdiff
path: root/fs/sysfs
diff options
context:
space:
mode:
authorDan Carpenter <error27@gmail.com>2010-08-25 09:12:29 +0200
committerGreg Kroah-Hartman <gregkh@suse.de>2010-09-20 13:36:29 -0700
commita319dbda7a69f218b56d7a3424f2dba3b7dc2350 (patch)
tree5c58d555b32e18c967ebd7e8006c0ea893b12608 /fs/sysfs
parent697c5a83eae7228e8591bbbf0f88dbbb73d281f7 (diff)
sysfs: checking for NULL instead of ERR_PTR
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>
Diffstat (limited to 'fs/sysfs')
-rw-r--r--fs/sysfs/file.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/sysfs/file.c b/fs/sysfs/file.c
index 1beaa739d0a..cd796847c81 100644
--- a/fs/sysfs/file.c
+++ b/fs/sysfs/file.c
@@ -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 */