From aaef7202817ad1a75f9d2baf0c5d6c2d820d1fed Mon Sep 17 00:00:00 2001 From: mananth Date: Thu, 16 Dec 2004 04:49:33 +0000 Subject: Patch from Kay - fix sysfs_get_classdev_attr(). --- CREDITS | 3 +++ ChangeLog | 4 ++++ lib/sysfs_class.c | 3 +++ 3 files changed, 10 insertions(+) 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 - Supplied patch to fix docs/libsysfs.txt + o Kay Sievers + - 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 + * Fix sysfs_get_classdev_attr() for case when the + sysfs_directory vanishes from beneath us + 11/18/2004 - Daniel Stekloff * 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) -- cgit v1.2.1