Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions events-arch-arm/non-standard-hisi_hip08.c
Original file line number Diff line number Diff line change
Expand Up @@ -676,6 +676,11 @@ static int decode_hip08_oem_type1_error(struct ras_events *ras,
(struct hisi_oem_type1_err_sec *)event->error;
struct ras_stmt *stmt = hip08_oem_type1_event_db.stmt;

if (!event->error || event->length < sizeof(*err)) {
trace_seq_printf(s, "%s: truncated payload\n", __func__);
return -1;
}

if (ras->record_events)
WARN_ONCE(!stmt, ALL, LOG_WARNING,
"Can't insert into table %s: no statement\n",
Expand Down Expand Up @@ -842,6 +847,11 @@ static int decode_hip08_oem_type2_error(struct ras_events *ras,
(struct hisi_oem_type2_err_sec *)event->error;
struct ras_stmt *stmt = hip08_oem_type2_event_db.stmt;

if (!event->error || event->length < sizeof(*err)) {
trace_seq_printf(s, "%s: truncated payload\n", __func__);
return -1;
}

if (ras->record_events)
WARN_ONCE(!stmt, ALL, LOG_WARNING,
"Can't insert into table %s: no statement\n",
Expand Down Expand Up @@ -987,6 +997,11 @@ static int decode_hip08_pcie_local_error(struct ras_events *ras,
(struct hisi_pcie_local_err_sec *)event->error;
struct ras_stmt *stmt = hip08_pcie_local_event_db.stmt;

if (!event->error || event->length < sizeof(*err)) {
trace_seq_printf(s, "%s: truncated payload\n", __func__);
return -1;
}

if (ras->record_events)
WARN_ONCE(!stmt, ALL, LOG_WARNING,
"Can't insert into table %s: no statement\n",
Expand Down
Loading