]> 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)
commitf0cfa8f6f34bfa5ed110506bce02af442297aa32
tree37814077fb7396a5542f2c9b5efbac2297f72723
parentc0ea271ec9e10501296c0f2b3cde25a36c647681
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