summaryrefslogtreecommitdiff
path: root/extras/scsi_id/scsi_id.h
diff options
context:
space:
mode:
authordsteklof@us.ibm.com <dsteklof@us.ibm.com>2003-12-17 19:05:25 -0800
committerGreg KH <gregkh@suse.de>2005-04-26 21:13:09 -0700
commitff3633bf9d192c46c457cc3819dc27ff2807ed0d (patch)
tree25fcb55c483fd8d1d8236f72eaa2d72a87af8afd /extras/scsi_id/scsi_id.h
parent77c46e9bd630806cf23741ead3d7551661973847 (diff)
[PATCH] fix scsi_id segfault with udev-009
Scsi_id hasn't been changed to use the latest libsysfs changes. The "directory" in the sysfs_class_device is now considered "private" and only should be accessed using functions. Treating the structures as handles lets us only load information when it's needed, reducing caching or stale information and also helping performance. Here's the problem. static inline char *sysfs_get_attr(struct sysfs_class_device *dev, const char *attr) { return sysfs_get_value_from_attributes(dev->directory->attributes, attr); } Please try this quick fix:
Diffstat (limited to 'extras/scsi_id/scsi_id.h')
-rw-r--r--extras/scsi_id/scsi_id.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/extras/scsi_id/scsi_id.h b/extras/scsi_id/scsi_id.h
index eb9498ab71..cb27e88a5f 100644
--- a/extras/scsi_id/scsi_id.h
+++ b/extras/scsi_id/scsi_id.h
@@ -42,8 +42,14 @@
static inline char *sysfs_get_attr(struct sysfs_class_device *dev,
const char *attr)
{
- return sysfs_get_value_from_attributes(dev->directory->attributes,
- attr);
+ struct dlist *attributes = NULL;
+
+ attributes = sysfs_get_classdev_attributes(dev);
+
+ if (attributes == NULL)
+ return NULL;
+
+ return sysfs_get_value_from_attributes(attributes, attr);
}
extern int scsi_get_serial (struct sysfs_class_device *scsi_dev,