summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormananth <mananth>2003-10-15 12:15:25 +0000
committermananth <mananth>2003-10-15 12:15:25 +0000
commitfc281a0436d90c72d33044190c95eb00be67f08a (patch)
tree4bcbd7fb954ef7bdfaa357932f14f1f52a1a32ed
parent1d4e840622d426b81616704c7ec2a636d218ca0d (diff)
downloadsysfsutils-fc281a0436d90c72d33044190c95eb00be67f08a.tar.gz
Fix a segfault while delinking driver's list of devices
-rw-r--r--ChangeLog4
-rw-r--r--lib/sysfs_driver.c3
2 files changed, 6 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 146ff7f..6393174 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,8 @@
+09/16/2003 - Ananth Mavinakayanahalli <ananth@in.ibm.com>
+ * Patch sysfs_close_driver() so as not to segfault when
+ during dlist shifting.
+
09/15/2003 - Ananth Mavinakayanahalli <ananth@in.ibm.com>
* Added sysfs_open_device_by_name() to open a device
given the device name
diff --git a/lib/sysfs_driver.c b/lib/sysfs_driver.c
index 63fef1f..6a5a913 100644
--- a/lib/sysfs_driver.c
+++ b/lib/sysfs_driver.c
@@ -39,7 +39,8 @@ void sysfs_close_driver(struct sysfs_driver *driver)
if (driver->devices != NULL) {
dlist_for_each(driver->devices)
dlist_shift(driver->devices);
- dlist_destroy(driver->devices);
+ free(driver->devices);
+ driver->devices = NULL;
}
if (driver->directory != NULL)
sysfs_close_directory(driver->directory);