Skip to content

Commit

Permalink
sysfs: checking for NULL instead of ERR_PTR
Browse files Browse the repository at this point in the history
d_path() returns an ERR_PTR and it doesn't return NULL.

Signed-off-by: Dan Carpenter <[email protected]>
Cc: stable <[email protected]>
Reviewed-by: "Eric W. Biederman" <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
error27 authored and gregkh committed Sep 4, 2010
1 parent 2bfc96a commit 57f9bda
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/sysfs/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down

0 comments on commit 57f9bda

Please sign in to comment.