ID: 297 - don't print-out SEL entry if ID not present

Don't print-out SEL log entry if SEL Record ID isn't present.

Patch-by: Mamatha Inamdar
This commit is contained in:
Zdenek Styblik 2014-03-23 07:51:05 +01:00
parent 02e4a0361c
commit 250eb15f92

View File

@ -2898,7 +2898,11 @@ ipmi_sel_show_entry(struct ipmi_intf * intf, int argc, char ** argv)
lprintf(LOG_DEBUG, "Looking up SEL entry 0x%x", id); lprintf(LOG_DEBUG, "Looking up SEL entry 0x%x", id);
/* lookup SEL entry based on ID */ /* lookup SEL entry based on ID */
ipmi_sel_get_std_entry(intf, id, &evt); if (!ipmi_sel_get_std_entry(intf, id, &evt)) {
lprintf(LOG_DEBUG, "SEL Entry 0x%x not found.", id);
rc = (-1);
continue;
}
if (evt.sel_type.standard_type.sensor_num == 0 && evt.sel_type.standard_type.sensor_type == 0 && evt.record_type == 0) { if (evt.sel_type.standard_type.sensor_num == 0 && evt.sel_type.standard_type.sensor_type == 0 && evt.record_type == 0) {
lprintf(LOG_WARN, "SEL Entry 0x%x not found", id); lprintf(LOG_WARN, "SEL Entry 0x%x not found", id);
rc = -1; rc = -1;