summaryrefslogtreecommitdiff
path: root/libsysfs/sysfs_class.c
diff options
context:
space:
mode:
authorkay.sievers@vrfy.org <kay.sievers@vrfy.org>2004-12-16 16:05:01 +0100
committerGreg KH <gregkh@suse.de>2005-04-26 23:17:47 -0700
commit83c35223ed164b95f53633b97846d0963c7bcea9 (patch)
tree399c7693a3923ac99ead8e2584a9ec193905f45f /libsysfs/sysfs_class.c
parent82ca88904d1c9bf17f4434f54e12754c00eddcbd (diff)
[PATCH] update libsysfs to CVS version and fix segfaulting attribute reading
Diffstat (limited to 'libsysfs/sysfs_class.c')
-rw-r--r--libsysfs/sysfs_class.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libsysfs/sysfs_class.c b/libsysfs/sysfs_class.c
index db59aef90f..a132bb64cb 100644
--- a/libsysfs/sysfs_class.c
+++ b/libsysfs/sysfs_class.c
@@ -640,6 +640,9 @@ struct sysfs_attribute *sysfs_get_classdev_attr
return cur;
}
+ if (clsdev->directory == NULL)
+ return NULL;
+
if (clsdev->directory->subdirs == NULL)
if ((sysfs_read_dir_subdirs(clsdev->directory)) != 0 ||
clsdev->directory->subdirs == NULL)