staging: fsl-dpaa2/eth: Fix incorrect kfree
authorIoana Radulescu <ruxandra.radulescu@nxp.com>
Wed, 14 Mar 2018 20:04:51 +0000 (15:04 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 25 May 2018 14:46:11 +0000 (16:46 +0200)
commitf7c516f1b6c5e8f0ea27d38989c5736ab0a4ef68
tree915f540a18a12621cf524cd942d9c20d0e86f231
parent4dd7e89ae23b4888af258e93469cb397156c68bf
staging: fsl-dpaa2/eth: Fix incorrect kfree

[ Upstream commit 6a9bbe53db9a5aa0be9788aa8a2c250dee55444b ]

Use netdev_alloc_frag() instead of kmalloc to allocate space for
the S/G table of egress multi-buffer frames.

This fixes a bug where an unaligned pointer received from the
allocator would be overwritten with the 64B aligned value,
leading to a wrong address being later passed to kfree.

Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.c