ID: 3600930 - 'lib/ipmi_sdr.c' - NULL dereference

Commit fixes NULL dereference in 'lib/ipmi_sdr.c' by checking whether Sensor is
type of 'full' or 'compact'.

Fix by: Jim Mank
Reported by: Ales Ledvinka
This commit is contained in:
Zdenek Styblik 2013-02-05 06:57:44 +00:00
parent bd4f34b035
commit c070fc00d6

View File

@ -1804,10 +1804,12 @@ ipmi_sdr_print_sensor_fc(struct ipmi_intf *intf,
SENSOR_PRINT_THRESH(sr->full, "Lower non-critical", lower.non_critical, lnc); SENSOR_PRINT_THRESH(sr->full, "Lower non-critical", lower.non_critical, lnc);
} }
ipmi_sdr_print_sensor_hysteresis(sensor, sr->full, ipmi_sdr_print_sensor_hysteresis(sensor, sr->full,
sr->full->threshold.hysteresis.positive, "Positive Hysteresis"); sr->full ? sr->full->threshold.hysteresis.positive :
sr->compact->threshold.hysteresis.positive, "Positive Hysteresis");
ipmi_sdr_print_sensor_hysteresis(sensor, sr->full, ipmi_sdr_print_sensor_hysteresis(sensor, sr->full,
sr->full->threshold.hysteresis.negative, "Negative Hysteresis"); sr->full ? sr->full->threshold.hysteresis.negative :
sr->compact->threshold.hysteresis.negative, "Negative Hysteresis");
print_sensor_min_max(sr->full); print_sensor_min_max(sr->full);