diff options
author | Stephen Warren <swarren@nvidia.com> | 2016-02-12 23:56:01 +0300 |
---|---|---|
committer | Marek Vasut <marex@denx.de> | 2016-02-24 21:12:33 +0300 |
commit | 53419bac4edc4d07225fa80ff1aedf0c301e7cc4 (patch) | |
tree | d5f8c552ae076325b05111eb801f627384d1cc9f /drivers/usb | |
parent | 7124a8c4cf014e88b1b569be4150459ca9a6345e (diff) | |
download | u-boot-53419bac4edc4d07225fa80ff1aedf0c301e7cc4.tar.xz |
usb: eth: fix memalign() parameter order
The alignment and size were swapped, leading to malloc heap corruption.
On my system, this sometimes caused U-Boot to crash during or after
certain USB Ethernet operations.
Fixes: c8c2797c3810 ("dm: usb: eth: Support driver model with USB Ethernet")
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Diffstat (limited to 'drivers/usb')
-rw-r--r-- | drivers/usb/eth/usb_ether.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/usb/eth/usb_ether.c b/drivers/usb/eth/usb_ether.c index b9c9a8402e..36734e2e51 100644 --- a/drivers/usb/eth/usb_ether.c +++ b/drivers/usb/eth/usb_ether.c @@ -73,7 +73,7 @@ int usb_ether_register(struct udevice *dev, struct ueth_data *ueth, int rxsize) } ueth->rxsize = rxsize; - ueth->rxbuf = memalign(rxsize, ARCH_DMA_MINALIGN); + ueth->rxbuf = memalign(ARCH_DMA_MINALIGN, rxsize); if (!ueth->rxbuf) return -ENOMEM; |