1 From: Lorenzo Bianconi <lorenzo@kernel.org>
2 Date: Tue, 12 Sep 2023 10:28:00 +0200
3 Subject: [PATCH] net: ethernet: mtk_wed: check update_wo_rx_stats in
4 mtk_wed_update_rx_stats()
6 Check if update_wo_rx_stats function pointer is properly set in
7 mtk_wed_update_rx_stats routine before accessing it.
9 Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
10 Reviewed-by: Simon Horman <horms@kernel.org>
11 Link: https://lore.kernel.org/r/b0d233386e059bccb59f18f69afb79a7806e5ded.1694507226.git.lorenzo@kernel.org
12 Signed-off-by: Paolo Abeni <pabeni@redhat.com>
15 --- a/drivers/net/ethernet/mediatek/mtk_wed_mcu.c
16 +++ b/drivers/net/ethernet/mediatek/mtk_wed_mcu.c
17 @@ -68,6 +68,9 @@ mtk_wed_update_rx_stats(struct mtk_wed_d
18 struct mtk_wed_wo_rx_stats *stats;
21 + if (!wed->wlan.update_wo_rx_stats)
24 if (count * sizeof(*stats) > skb->len - sizeof(u32))