mirror of
https://github.com/torvalds/linux.git
synced 2026-05-30 01:53:29 +02:00
bnxt_en: Fix null pointer dereference in bnxt_bs_trace_check_wrap()
With older FW, we may get the ASYNC_EVENT_CMPL_EVENT_ID_DBG_BUF_PRODUCER
for FW trace data type that has not been initialized. This will result
in a crash in bnxt_bs_trace_type_wrap(). Add a guard to check for a
valid magic_byte pointer before proceeding.
Fixes: 84fcd9449f ("bnxt_en: Manage the FW trace context memory")
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Shruti Parab <shruti.parab@broadcom.com>
Signed-off-by: Gautam R A <gautam-r.a@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Link: https://patch.msgid.link/20251104005700.542174-4-michael.chan@broadcom.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
deb8eb3916
commit
ff02be05f7
|
|
@ -2149,7 +2149,7 @@ struct bnxt_bs_trace_info {
|
|||
static inline void bnxt_bs_trace_check_wrap(struct bnxt_bs_trace_info *bs_trace,
|
||||
u32 offset)
|
||||
{
|
||||
if (!bs_trace->wrapped &&
|
||||
if (!bs_trace->wrapped && bs_trace->magic_byte &&
|
||||
*bs_trace->magic_byte != BNXT_TRACE_BUF_MAGIC_BYTE)
|
||||
bs_trace->wrapped = 1;
|
||||
bs_trace->last_offset = offset;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user