mirror of
https://github.com/lm-sensors/lm-sensors.git
synced 2026-11-07 16:01:34 +00:00
Looking up a mapping can't fail if looking up the feature itself
succeeded (or that would be a bug in the library code.) git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4729 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
1 parent
2ee12591df
commit
38d1d82cec
1 file changed
+10
-6
+10
-6
@@ -231,11 +231,13 @@ int sensors_get_value(const sensors_chip_name *name, int feature,
|
||||
return -SENSORS_ERR_WILDCARDS;
|
||||
if (!(main_feature = sensors_lookup_feature_nr(name, feature)))
|
||||
return -SENSORS_ERR_NO_ENTRY;
|
||||
|
||||
if (main_feature->data.compute_mapping == SENSORS_NO_MAPPING)
|
||||
alt_feature = NULL;
|
||||
else if (!(alt_feature = sensors_lookup_feature_nr(name,
|
||||
main_feature->data.compute_mapping)))
|
||||
return -SENSORS_ERR_NO_ENTRY;
|
||||
else
|
||||
alt_feature = sensors_lookup_feature_nr(name,
|
||||
main_feature->data.compute_mapping);
|
||||
|
||||
if (!(main_feature->data.mode & SENSORS_MODE_R))
|
||||
return -SENSORS_ERR_ACCESS_R;
|
||||
for (chip = NULL;
|
||||
@@ -276,11 +278,13 @@ int sensors_set_value(const sensors_chip_name *name, int feature,
|
||||
return -SENSORS_ERR_WILDCARDS;
|
||||
if (!(main_feature = sensors_lookup_feature_nr(name, feature)))
|
||||
return -SENSORS_ERR_NO_ENTRY;
|
||||
|
||||
if (main_feature->data.compute_mapping == SENSORS_NO_MAPPING)
|
||||
alt_feature = NULL;
|
||||
else if (!(alt_feature = sensors_lookup_feature_nr(name,
|
||||
main_feature->data.compute_mapping)))
|
||||
return -SENSORS_ERR_NO_ENTRY;
|
||||
else
|
||||
alt_feature = sensors_lookup_feature_nr(name,
|
||||
main_feature->data.compute_mapping);
|
||||
|
||||
if (!(main_feature->data.mode & SENSORS_MODE_W))
|
||||
return -SENSORS_ERR_ACCESS_W;
|
||||
for (chip = NULL;
|
||||
|
||||
Reference in new issue
Block a user