diff options
author | mananth <mananth> | 2003-10-15 12:15:25 +0000 |
---|---|---|
committer | mananth <mananth> | 2003-10-15 12:15:25 +0000 |
commit | fc281a0436d90c72d33044190c95eb00be67f08a (patch) | |
tree | 4bcbd7fb954ef7bdfaa357932f14f1f52a1a32ed | |
parent | 1d4e840622d426b81616704c7ec2a636d218ca0d (diff) | |
download | sysfsutils-fc281a0436d90c72d33044190c95eb00be67f08a.tar.gz |
Fix a segfault while delinking driver's list of devices
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | lib/sysfs_driver.c | 3 |
2 files changed, 6 insertions, 1 deletions
@@ -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); |