summaryrefslogtreecommitdiff
path: root/stand/uboot
diff options
context:
space:
mode:
authorToomas Soome <tsoome@FreeBSD.org>2020-01-13 18:22:54 +0000
committerToomas Soome <tsoome@FreeBSD.org>2020-01-13 18:22:54 +0000
commit659bf32dfc595b6cd6aeda7f05cb57872c64d2d1 (patch)
tree41d2ae5bf29eaef2c496549fde0049ac3d6d63cc /stand/uboot
parent6e6161d2208effcba45f3717cddff8d3e3867758 (diff)
downloadsrc-test-659bf32dfc595b6cd6aeda7f05cb57872c64d2d1.tar.gz
src-test-659bf32dfc595b6cd6aeda7f05cb57872c64d2d1.zip
loader: allocate properly aligned buffer for network packet
Use memalign(4, size) to ensure we have properly aligned buffer. MFC after: 2 weeks
Notes
Notes: svn path=/head/; revision=356693
Diffstat (limited to 'stand/uboot')
-rw-r--r--stand/uboot/lib/net.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/stand/uboot/lib/net.c b/stand/uboot/lib/net.c
index 2e1b9ab4caa45..852faa794ca16 100644
--- a/stand/uboot/lib/net.c
+++ b/stand/uboot/lib/net.c
@@ -302,7 +302,7 @@ net_get(struct iodesc *desc, void **pkt, time_t timeout)
#endif
if (rlen > 0) {
- buf = malloc(rlen + ETHER_ALIGN);
+ buf = memalign(4, rlen + ETHER_ALIGN);
if (buf == NULL)
return (-1);
memcpy(buf + ETHER_ALIGN, sc->sc_rxbuf, rlen);