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>
diff --git a/drivers/usb/eth/usb_ether.c b/drivers/usb/eth/usb_ether.c
index b9c9a84..36734e2 100644
--- a/drivers/usb/eth/usb_ether.c
+++ b/drivers/usb/eth/usb_ether.c
@@ -73,7 +73,7 @@
}
ueth->rxsize = rxsize;
- ueth->rxbuf = memalign(rxsize, ARCH_DMA_MINALIGN);
+ ueth->rxbuf = memalign(ARCH_DMA_MINALIGN, rxsize);
if (!ueth->rxbuf)
return -ENOMEM;