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.34.8~205 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=33f19e56a712a1d7c3dead0ef0fb335a25083e6d;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 Signed-off-by: Paul Gortmaker --- diff --git a/fs/sysfs/file.c b/fs/sysfs/file.c index e222b2582746..0831b8838498 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 */