]> git.baikalelectronics.ru Git - kernel.git/commit
gianfar: simplify FCS handling and fix memory leak
authorAndy Spencer <aspencer@spacex.com>
Thu, 22 Feb 2018 19:05:33 +0000 (11:05 -0800)
committerDavid S. Miller <davem@davemloft.net>
Fri, 23 Feb 2018 17:26:36 +0000 (12:26 -0500)
commit3c7386860a98047db30ba472e340df9e071f7264
tree37814077fb7396a5542f2c9b5efbac2297f72723
parent0010c1b323c47ff7c71f5f67feb39b9ecde4515d
gianfar: simplify FCS handling and fix memory leak

Previously, buffer descriptors containing only the frame check sequence
(FCS) were skipped and not added to the skb. However, the page reference
count was still incremented, leading to a memory leak.

Fixing this inside gfar_add_rx_frag() is difficult due to reserved
memory handling and page reuse. Instead, move the FCS handling to
gfar_process_frame() and trim off the FCS before passing the skb up the
networking stack.

Signed-off-by: Andy Spencer <aspencer@spacex.com>
Signed-off-by: Jim Gruen <jgruen@spacex.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/freescale/gianfar.c