chiark / gitweb /
[PATCH] fix scsi_id segfault with udev-009
[elogind.git] / extras / scsi_id / scsi_id.h
index eb9498ab71f0fb35a9b5eaac491c605f1d9a38a0..cb27e88a5f308707a558559c3060513908ee4c57 100644 (file)
 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,