]> git.baikalelectronics.ru Git - kernel.git/commit
sfc: Fix memory leak when discarding scattered packets
authorBen Hutchings <bhutchings@solarflare.com>
Thu, 4 Jul 2013 22:48:46 +0000 (23:48 +0100)
committerDavid S. Miller <davem@davemloft.net>
Fri, 5 Jul 2013 08:29:15 +0000 (01:29 -0700)
commitf2c5db227c093e24c3872738ce0b0e88741a2477
tree410ed812608383a8e88ffe16cc228be20bf2240b
parent0ed2426e46b3444ed9928fc2c2cda6c30860db90
sfc: Fix memory leak when discarding scattered packets

Commit 7d8bfb495d1c ('sfc: reuse pages to avoid DMA mapping/unmapping
costs') did not fully take account of DMA scattering which was
introduced immediately before.  If a received packet is invalid and
must be discarded, we only drop a reference to the first buffer's
page, but we need to drop a reference for each buffer the packet
used.

I think this bug was missed partly because efx_recycle_rx_buffers()
was not renamed and so no longer does what its name says.  It does not
change the state of buffers, but only prepares the underlying pages
for recycling.  Rename it accordingly.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/sfc/rx.c