mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-09 22:50:41 +00:00
sysfs: checking for NULL instead of ERR_PTR
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>
This commit is contained in:
parent
2bfc96a127
commit
57f9bdac25
@ -340,7 +340,7 @@ static int sysfs_open_file(struct inode *inode, struct file *file)
|
|||||||
char *p;
|
char *p;
|
||||||
|
|
||||||
p = d_path(&file->f_path, last_sysfs_file, sizeof(last_sysfs_file));
|
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);
|
memmove(last_sysfs_file, p, strlen(p) + 1);
|
||||||
|
|
||||||
/* need attr_sd for attr and ops, its parent for kobj */
|
/* need attr_sd for attr and ops, its parent for kobj */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user