1
0
Fork 0
mirror of synced 2025-03-06 20:59:54 +01:00
linux/drivers/net/ethernet/freescale
Wei Fang 19e72b064f net: fec: check the return value of build_skb()
The build_skb might return a null pointer but there is no check on the
return value in the fec_enet_rx_queue(). So a null pointer dereference
might occur. To avoid this, we check the return value of build_skb. If
the return value is a null pointer, the driver will recycle the page and
update the statistic of ndev. Then jump to rx_processing_done to clear
the status flags of the BD so that the hardware can recycle the BD.

Fixes: 95698ff617 ("net: fec: using page pool to manage RX buffers")
Signed-off-by: Wei Fang <wei.fang@nxp.com>
Reviewed-by: Shenwei Wang <Shenwei.wang@nxp.com>
Reviewed-by: Alexander Duyck <alexanderduyck@fb.com>
Link: https://lore.kernel.org/r/20221219022755.1047573-1-wei.fang@nxp.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2022-12-20 11:33:24 -08:00
..
dpaa Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2022-10-24 13:44:11 -07:00
dpaa2 Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2022-12-08 18:19:59 -08:00
enetc net: enetc: avoid buffer leaks on xdp_do_redirect() failure 2022-12-14 20:24:23 -08:00
fman net: fman: remove reference to non-existing config PCS 2022-11-18 19:19:58 -08:00
fs_enet net: ethernet: remove fs_mii_disconnect and fs_mii_connect declarations 2022-09-19 14:08:14 -07:00
fec.h net: fec: add xdp and page pool statistics 2022-11-14 11:28:55 +00:00
fec_main.c net: fec: check the return value of build_skb() 2022-12-20 11:33:24 -08:00
fec_mpc52xx.c powerpc/mpc5xxx: Switch mpc5xxx_get_bus_frequency() to use fwnode 2022-06-22 12:51:49 +10:00
fec_mpc52xx.h
fec_mpc52xx_phy.c powerpc/mpc5xxx: Switch mpc5xxx_get_bus_frequency() to use fwnode 2022-06-22 12:51:49 +10:00
fec_ptp.c ptp: convert remaining drivers to adjfine interface 2022-11-11 10:58:39 +00:00
fsl_pq_mdio.c net: freescale: convert comma to semicolon 2020-12-09 16:23:08 -08:00
gianfar.c net: drop the weight argument from netif_napi_add 2022-09-28 18:57:14 -07:00
gianfar.h eth: gfar: remove a copy of the NAPI_POLL_WEIGHT define 2022-04-29 11:56:42 +01:00
gianfar_ethtool.c net: ethernet: move from strlcpy with unused retval to strscpy 2022-08-31 14:11:26 -07:00
Kconfig net: fec: add xdp and page pool statistics 2022-11-14 11:28:55 +00:00
Makefile net: enetc: fix link error again 2021-04-22 13:23:07 -07:00
ucc_geth.c net: drop the weight argument from netif_napi_add 2022-09-28 18:57:14 -07:00
ucc_geth.h ethernet: ucc_geth: simplify rx/tx allocations 2021-01-21 12:19:56 -08:00
ucc_geth_ethtool.c net: ethernet: move from strlcpy with unused retval to strscpy 2022-08-31 14:11:26 -07:00
xgmac_mdio.c net: freescale: xgmac: Do not dereference fwnode in struct device 2022-08-22 14:53:13 +01:00