2
0

752-04-v6.6-net-ethernet-mtk_wed-check-update_wo_rx_stats-in-mtk.patch 879 B

1234567891011121314151617181920212223242526
  1. From: Lorenzo Bianconi <[email protected]>
  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()
  5. Check if update_wo_rx_stats function pointer is properly set in
  6. mtk_wed_update_rx_stats routine before accessing it.
  7. Signed-off-by: Lorenzo Bianconi <[email protected]>
  8. Reviewed-by: Simon Horman <[email protected]>
  9. Link: https://lore.kernel.org/r/b0d233386e059bccb59f18f69afb79a7806e5ded.1694507226.git.lorenzo@kernel.org
  10. Signed-off-by: Paolo Abeni <[email protected]>
  11. ---
  12. --- a/drivers/net/ethernet/mediatek/mtk_wed_mcu.c
  13. +++ b/drivers/net/ethernet/mediatek/mtk_wed_mcu.c
  14. @@ -68,6 +68,9 @@ mtk_wed_update_rx_stats(struct mtk_wed_d
  15. struct mtk_wed_wo_rx_stats *stats;
  16. int i;
  17. + if (!wed->wlan.update_wo_rx_stats)
  18. + return;
  19. +
  20. if (count * sizeof(*stats) > skb->len - sizeof(u32))
  21. return;