From: Dan Carpenter Date: Wed, 25 Aug 2010 07:12:29 +0000 (+0200) Subject: sysfs: checking for NULL instead of ERR_PTR X-Git-Tag: v2.6.32.22~88 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=88c0bb95c7e71d972f77ec4ea1be611b7e015066;p=karo-tx-linux.git sysfs: checking for NULL instead of ERR_PTR commit 57f9bdac2510cd7fda58e4a111d250861eb1ebeb upstream. d_path() returns an ERR_PTR and it doesn't return NULL. Signed-off-by: Dan Carpenter Reviewed-by: "Eric W. Biederman" Signed-off-by: Greg Kroah-Hartman --- diff --git a/fs/sysfs/file.c b/fs/sysfs/file.c index f5ea4680f15f..7118a383a87a 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 */