summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormananth <mananth>2004-12-16 04:49:33 +0000
committermananth <mananth>2004-12-16 04:49:33 +0000
commitaaef7202817ad1a75f9d2baf0c5d6c2d820d1fed (patch)
tree24005772e49c9973e40af93cf5b2350a7e5f0b95
parent79da2f822769a0d78d5cc4a15468bec8cd8bc1f4 (diff)
downloadsysfsutils-aaef7202817ad1a75f9d2baf0c5d6c2d820d1fed.tar.gz
Patch from Kay - fix sysfs_get_classdev_attr().
-rw-r--r--CREDITS3
-rw-r--r--ChangeLog4
-rw-r--r--lib/sysfs_class.c3
3 files changed, 10 insertions, 0 deletions
diff --git a/CREDITS b/CREDITS
index 515e49d..2489107 100644
--- a/CREDITS
+++ b/CREDITS
@@ -29,3 +29,6 @@ have made contributions:
- Supplied patch to fix SEGV in dlist.c
o Arun Bhanu <arun@codemovers.org>
- Supplied patch to fix docs/libsysfs.txt
+ o Kay Sievers <kay.sievers@vrfy.org>
+ - Supplied patch to fix sysfs_get_classdir_attr when
+ the directory vanishes from under us.
diff --git a/ChangeLog b/ChangeLog
index e6a0737..9d5ff28 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,8 @@
+12/16/2004 - Kay Sievers <kay.sievers@vrfy.org>
+ * Fix sysfs_get_classdev_attr() for case when the
+ sysfs_directory vanishes from beneath us
+
11/18/2004 - Daniel Stekloff <dsteklof@us.ibm.com>
* Check "driver" link under the device dir before
taking the "brute-force" route
diff --git a/lib/sysfs_class.c b/lib/sysfs_class.c
index db59aef..a132bb6 100644
--- a/lib/sysfs_class.c
+++ b/lib/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)