aboutsummaryrefslogtreecommitdiff
path: root/lib/assoc_array.c
diff options
context:
space:
mode:
authorDean Jenkins <[email protected]>2015-10-02 14:29:06 +0100
committerDavid S. Miller <[email protected]>2015-10-05 06:58:41 -0700
commit9a5ccd8e039eef53336e45d01c7d8a1acbd36b47 (patch)
tree9f739aa521400ea6c9ce482fe2b5ffa80660ca43 /lib/assoc_array.c
parent3bfc69abf802f56901ffd83bb66b7dd7644ddcc3 (diff)
asix: Simplify asix_rx_fixup_internal() netdev alloc
The code is checking that the Ethernet frame will fit into a netdev allocated socket buffer within the constraints of MTU size, Ethernet header length plus VLAN header length. The original code was checking rx->remaining each loop of the while loop that processes multiple Ethernet frames per URB and/or Ethernet frames that span across URBs. rx->remaining decreases per while loop so there is no point in potentially checking multiple times that the Ethernet frame (remaining part) will fit into the netdev socket buffer. The modification checks that the size of the Ethernet frame will fit the netdev socket buffer before allocating the netdev socket buffer. This avoids grabbing memory and then deciding that the Ethernet frame is too big and then freeing the memory. Signed-off-by: Dean Jenkins <[email protected]> Signed-off-by: Mark Craske <[email protected]> Signed-off-by: David S. Miller <[email protected]>
Diffstat (limited to 'lib/assoc_array.c')
0 files changed, 0 insertions, 0 deletions