]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commit
dpaa2-eth: fix memory leak in XDP_REDIRECT
authorIoana Ciornei <ioana.ciornei@nxp.com>
Thu, 11 Feb 2021 19:51:22 +0000 (21:51 +0200)
committerDavid S. Miller <davem@davemloft.net>
Fri, 12 Feb 2021 02:15:15 +0000 (18:15 -0800)
commite12be9139cca26d689fe1a9257054b76752f725b
treea49b05a947a0672e337fdca7b5fc924e79a58366
parente185ea30df1f6fee40d10ea98e6e11f9af9846d4
dpaa2-eth: fix memory leak in XDP_REDIRECT

If xdp_do_redirect() fails, the calling driver should handle recycling
or freeing of the page associated with the frame. The dpaa2-eth driver
didn't do either of them and just incremented a counter.
Fix this by trying to DMA map back the page and recycle it or, if the
mapping fails, just free it.

Fixes: d678be1dc1ec ("dpaa2-eth: add XDP_REDIRECT support")
Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c