Skip to contentSkip to conversation

sysfs fix for 2.6.36-git

PATCH New Greg KH 1 participant 2 messages Sep 4, 2010 Driver core

lore
Share & tools
lore

Greg KH

author
#0 lore raw

PATCH 1/1 sysfs fix for 2.6.36-git

Here's a single sysfs fix for your 2.6.36-git tree.

Please pull from:
master.kernel.org:/pub/scm/linux/kernel/git/gregkh/driver-core-2.6.git/

This patch has been in the linux-next and mm trees for a bit.

The patch will be sent as a follow-on to this message to lkml for people to see.

thanks,

greg k-h

------------

 fs/sysfs/file.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

---------------

Dan Carpenter (1):
sysfs: checking for NULL instead of ERR_PTR

#1 lore raw

PATCH 1/1 sysfs: checking for NULL instead of ERR_PTR

From: Dan Carpenter <[email protected]>

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

---
 fs/sysfs/file.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
fs/sysfs/file.c +1 -1
index 1b27b56..da3fefe 100644
@@ -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 */
Signature · 1 line
1.7.2