summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/mediatek
diff options
context:
space:
mode:
authorLorenzo Bianconi <lorenzo@kernel.org>2023-09-12 10:28:00 +0200
committerPaolo Abeni <pabeni@redhat.com>2023-09-14 15:33:00 +0200
commit486e6ca6b48d68d7fefc99e15cc1865e2210d893 (patch)
treed3760e6da9793c333b580ba47e738f4afbca956d /drivers/net/ethernet/mediatek
parentnet: ethernet: mtk_eth_soc: rely on mtk_pse_port definitions in mtk_flow_set_... (diff)
downloadlinux-486e6ca6b48d68d7fefc99e15cc1865e2210d893.tar.xz
linux-486e6ca6b48d68d7fefc99e15cc1865e2210d893.zip
net: ethernet: mtk_wed: check update_wo_rx_stats in mtk_wed_update_rx_stats()
Check if update_wo_rx_stats function pointer is properly set in mtk_wed_update_rx_stats routine before accessing it. Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Reviewed-by: Simon Horman <horms@kernel.org> Link: https://lore.kernel.org/r/b0d233386e059bccb59f18f69afb79a7806e5ded.1694507226.git.lorenzo@kernel.org Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Diffstat (limited to 'drivers/net/ethernet/mediatek')
-rw-r--r--drivers/net/ethernet/mediatek/mtk_wed_mcu.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/net/ethernet/mediatek/mtk_wed_mcu.c b/drivers/net/ethernet/mediatek/mtk_wed_mcu.c
index 071ed3dea860..72bcdaed12a9 100644
--- a/drivers/net/ethernet/mediatek/mtk_wed_mcu.c
+++ b/drivers/net/ethernet/mediatek/mtk_wed_mcu.c
@@ -68,6 +68,9 @@ mtk_wed_update_rx_stats(struct mtk_wed_device *wed, struct sk_buff *skb)
struct mtk_wed_wo_rx_stats *stats;
int i;
+ if (!wed->wlan.update_wo_rx_stats)
+ return;
+
if (count * sizeof(*stats) > skb->len - sizeof(u32))
return;