Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 57f9bdac authored by Dan Carpenter's avatar Dan Carpenter Committed by Greg Kroah-Hartman
Browse files

sysfs: checking for NULL instead of ERR_PTR



d_path() returns an ERR_PTR and it doesn't return NULL.

Signed-off-by: default avatarDan Carpenter <error27@gmail.com>
Cc: stable <stable@kernel.org>
Reviewed-by: default avatar"Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 2bfc96a1
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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 */