Don't choke on unrecognized devices (#2087).

git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@5086 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
Jean Delvare committed 2007-12-27 15:35:04 +00:00
1 parent 938a627d3e
commit baf6c7143a
2 files changed
+7 -2

No files matched your search

+1
View File
@@ -4,6 +4,7 @@ lm_sensors CHANGES file
SVN-HEAD
Library: Fix fschrc and fschmd support
Fix sysfs presence detection
Don't choke on unrecognized devices (#2087)
Makefile: Revert changeset 4738, fix bug #2187 differently
Module adm1026: Various cleanups
Module eeprom: Hide Sony Vaio serial numbers to regular users (2.6 backport)
+6 -2
View File
@@ -60,6 +60,7 @@ static int sensors_read_one_sysfs_chip(struct sysfs_device *dev)
struct sysfs_attribute *attr, *bus_attr;
char bus_path[SYSFS_PATH_MAX];
sensors_proc_chips_entry entry;
int err = -SENSORS_ERR_PARSE;
/* ignore any device without name attribute */
if (!(attr = sysfs_get_device_attr(dev, "name")))
@@ -112,8 +113,11 @@ static int sensors_read_one_sysfs_chip(struct sysfs_device *dev)
/* PCI */
entry.name.addr = (domain << 16) + (bus << 8) + (slot << 3) + fn;
entry.name.bus = SENSORS_CHIP_NAME_BUS_PCI;
} else
} else {
/* Ignore unknown devices */
err = 0;
goto exit_free;
}
sensors_add_proc_chips(&entry);
@@ -122,7 +126,7 @@ static int sensors_read_one_sysfs_chip(struct sysfs_device *dev)
exit_free:
free(entry.name.prefix);
free(entry.name.busname);
return -SENSORS_ERR_PARSE;
return err;
}
/* returns 0 if successful, !0 otherwise */