From 46c0ae46d751cd1e63969cc840c0490245ad6a58 Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Sun, 16 Mar 2008 17:30:20 +0000 Subject: [PATCH] Don't choke on unrecognized devices, part 2. In case hwmon devices have no underlying physical device, just ignore them. This happened in kernel 2.6.25-rc5-git4 with the newly added generic thermal zone device. git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@5147 7894878c-1315-0410-8ee3-d5d059ff63e0 --- CHANGES | 3 ++- lib/sysfs.c | 6 ++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/CHANGES b/CHANGES index af5e7207..873e05f7 100644 --- a/CHANGES +++ b/CHANGES @@ -2,12 +2,13 @@ lm_sensors CHANGES file ----------------------- SVN-HEAD + Library: Don't choke on unrecognized devices, part 2 Program sensors-detect: New device ID for the SMSC SCH5317 2.10.6 "Welcome Home Lina" (20080306) Library: Fix fschrc and fschmd support Fix sysfs presence detection - Don't choke on unrecognized devices (#2087) + Don't choke on unrecognized devices, part 1 (#2087) Fix lm93 vid2 access (#2295) No in1 on w83783s Support DOS-style configuration files again (#2284) diff --git a/lib/sysfs.c b/lib/sysfs.c index 2adcf8cb..19f542e0 100644 --- a/lib/sysfs.c +++ b/lib/sysfs.c @@ -182,10 +182,8 @@ int sensors_read_sysfs_chips(void) dlist_for_each_data(clsdevs, clsdev, struct sysfs_class_device) { struct sysfs_device *dev; - if (!(dev = sysfs_get_classdev_device(clsdev))) { - ret = -SENSORS_ERR_PROC; - goto exit; - } + if (!(dev = sysfs_get_classdev_device(clsdev))) + continue; if ((ret = sensors_read_one_sysfs_chip(dev))) goto exit; }