net: ethernet: mtk_wed: fix possible NULL pointer dereference in mtk_wed_wo_queue_tx_...
authorLorenzo Bianconi <lorenzo@kernel.org>
Sun, 17 Dec 2023 15:37:40 +0000 (16:37 +0100)
committerPaolo Abeni <pabeni@redhat.com>
Thu, 21 Dec 2023 07:09:22 +0000 (08:09 +0100)
commit7cb8cd4daacfea646cf8b5925ca2c66c98b18480
treeeae3d28872e7ad9ed79d19969e4134889e25e0e8
parentbd7f77dae69532ffc027ee50ff99e3792dc30b7f
net: ethernet: mtk_wed: fix possible NULL pointer dereference in mtk_wed_wo_queue_tx_clean()

In order to avoid a NULL pointer dereference, check entry->buf pointer before running
skb_free_frag in mtk_wed_wo_queue_tx_clean routine.

Fixes: 799684448e3e ("net: ethernet: mtk_wed: introduce wed wo support")
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://lore.kernel.org/r/3c1262464d215faa8acebfc08869798c81c96f4a.1702827359.git.lorenzo@kernel.org
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
drivers/net/ethernet/mediatek/mtk_wed_wo.c