Skip to content

Commit

Permalink
qed: off by one in qed_parse_mcp_trace_buf()
Browse files Browse the repository at this point in the history
If format_idx == s_mcp_trace_meta.formats_num then we read one element
beyond the end of the s_mcp_trace_meta.formats[] array.

Fixes: 50bc60c ("qed*: Utilize FW 8.33.11.0")
Signed-off-by: Dan Carpenter <[email protected]>
Acked-by: Tomer Tayar <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
Dan Carpenter authored and davem330 committed Jul 5, 2018
1 parent 5e7ba04 commit 0df8adb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/ethernet/qlogic/qed/qed_debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -6723,7 +6723,7 @@ static enum dbg_status qed_parse_mcp_trace_buf(u8 *trace_buf,
format_idx = header & MFW_TRACE_EVENTID_MASK;

/* Skip message if its index doesn't exist in the meta data */
if (format_idx > s_mcp_trace_meta.formats_num) {
if (format_idx >= s_mcp_trace_meta.formats_num) {
u8 format_size =
(u8)((header & MFW_TRACE_PRM_SIZE_MASK) >>
MFW_TRACE_PRM_SIZE_SHIFT);
Expand Down

0 comments on commit 0df8adb

Please sign in to comment.