Staging: Octeon Ethernet: Fix memory allocation.
authorDavid Daney <ddaney@caviumnetworks.com>
Wed, 27 Jan 2010 21:22:53 +0000 (13:22 -0800)
committerRalf Baechle <ralf@linux-mips.org>
Sat, 27 Feb 2010 11:53:07 +0000 (12:53 +0100)
commit166bdaa9aad9903bf4330ef68feb37f220c9eac8
tree2afbf9f99ff30c7276fe3ceb54477216e482bf0b
parent6568a234363978e1aebb5b7c9840ed87eed20362
Staging: Octeon Ethernet: Fix memory allocation.

After aligning the blocks returned by kmalloc, we need to save the original
pointer so they can be correctly freed.

There are no guarantees about the alignment of SKB data, so we need to
handle worst case alignment.

Since right shifts over subtraction have no distributive property, we need
to fix the back pointer calculation.

Signed-off-by: David Daney <ddaney@caviumnetworks.com>
To: linux-mips@linux-mips.org
Patchwork: http://patchwork.linux-mips.org/patch/884/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
drivers/staging/octeon/ethernet-mem.c
drivers/staging/octeon/ethernet-tx.c