projects
/
GitHub
/
MotorolaMobilityLLC
/
kernel-slsi.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2bfc96a
)
sysfs: checking for NULL instead of ERR_PTR
author
Dan Carpenter
<error27@gmail.com>
Wed, 25 Aug 2010 07:12:29 +0000
(09:12 +0200)
committer
Greg Kroah-Hartman
<gregkh@suse.de>
Sat, 4 Sep 2010 00:26:28 +0000
(17:26 -0700)
d_path() returns an ERR_PTR and it doesn't return NULL.
Signed-off-by: Dan Carpenter <error27@gmail.com>
Cc: stable <stable@kernel.org>
Reviewed-by: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
fs/sysfs/file.c
patch
|
blob
|
blame
|
history
diff --git
a/fs/sysfs/file.c
b/fs/sysfs/file.c
index 1b27b5688f62fdfd8abd40386c6e1ece7aa1bf49..da3fefe91a8f855f59e62c84f0ef70a2a9bd0524 100644
(file)
--- 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 */