aboutsummaryrefslogtreecommitdiff
path: root/stand/libofw
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/libofw
parent6e6161d2208effcba45f3717cddff8d3e3867758 (diff)
downloadsrc-659bf32dfc595b6cd6aeda7f05cb57872c64d2d1.tar.gz
src-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/libofw')
-rw-r--r--stand/libofw/ofw_net.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/stand/libofw/ofw_net.c b/stand/libofw/ofw_net.c
index 14494ecc2b2e..a037c3defaf5 100644
--- a/stand/libofw/ofw_net.c
+++ b/stand/libofw/ofw_net.c
@@ -142,7 +142,7 @@ ofwn_get(struct iodesc *desc, void **pkt, time_t timeout)
* a small shortcut here.
*/
len = ETHER_MAX_LEN;
- buf = malloc(len + ETHER_ALIGN);
+ buf = memalign(4, len + ETHER_ALIGN);
if (buf == NULL)
return (-1);
ptr = buf + ETHER_ALIGN;