Re: [PATCH] wifi: ath9k: add a defensive NULL check to prevent null-pointer dereference in ath9k_beacon_remove_slot()

From: Toke Høiland-Jørgensen

Date: Wed Jan 07 2026 - 05:03:36 EST


Tuo Li <islituo@xxxxxxxxx> writes:

> In this function, bf is guarded by an if statement, indicating that it may
> be NULL:
>
> if (bf && bf->bf_mpdu) {...}
>
> If bf is NULL, calling list_add_tail() may result in a null-pointer
> dereference:
>
> list_add_tail(&bf->list, &sc->beacon.bbuf);
>
> Therefore, add a defensive NULL check before invoking list_add_tail() to
> prevent this issue.
>
> Signed-off-by: Tuo Li <islituo@xxxxxxxxx>

Are you fixing an actual bug here? Otherwise, this is not worth the
churn...

-Toke