]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit4a0afd9157a56d346903769570a15f04938dd290
tree2afbf9f99ff30c7276fe3ceb54477216e482bf0b
parent8eed063917bb9cc557db2a2adf0cdd17e324f4fe
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