Messages in this thread Patch in this message | | | From | Greg Kroah-Hartman <> | Subject | [PATCH 1/1] sysfs: checking for NULL instead of ERR_PTR | Date | Fri, 3 Sep 2010 19:12:54 -0700 |
| |
From: Dan Carpenter <error27@gmail.com>
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 | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/fs/sysfs/file.c b/fs/sysfs/file.c index 1b27b56..da3fefe 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 */ -- 1.7.2
| |