git: bdf50dc5afbc - stable/12 - Backout 356693. The libsa malloc does provide necessary alignment and memalign by 4 will reduce alignment for some platforms. Thanks for Ian for pointing this out.
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Thu, 07 Oct 2021 03:37:43 UTC
The branch stable/12 has been updated by kevans:
URL: https://cgit.FreeBSD.org/src/commit/?id=bdf50dc5afbce81cce2d0759ee36108c3cc8614b
commit bdf50dc5afbce81cce2d0759ee36108c3cc8614b
Author: Toomas Soome <tsoome@FreeBSD.org>
AuthorDate: 2020-01-13 20:02:27 +0000
Commit: Kyle Evans <kevans@FreeBSD.org>
CommitDate: 2021-10-07 03:37:10 +0000
Backout 356693. The libsa malloc does provide necessary alignment and
memalign by 4 will reduce alignment for some platforms. Thanks for Ian for
pointing this out.
(cherry picked from commit aaeffe5b7064536dc7f4ea75a58125ec69d2706b)
---
stand/efi/libefi/efinet.c | 2 +-
stand/i386/libi386/pxe.c | 2 +-
stand/libofw/ofw_net.c | 2 +-
stand/uboot/lib/net.c | 2 +-
4 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/stand/efi/libefi/efinet.c b/stand/efi/libefi/efinet.c
index 989b2efdaac2..418790524e4a 100644
--- a/stand/efi/libefi/efinet.c
+++ b/stand/efi/libefi/efinet.c
@@ -178,7 +178,7 @@ efinet_get(struct iodesc *desc, void **pkt, time_t timeout)
return (ret);
bufsz = net->Mode->MaxPacketSize + ETHER_HDR_LEN + ETHER_CRC_LEN;
- buf = memalign(4, bufsz + ETHER_ALIGN);
+ buf = malloc(bufsz + ETHER_ALIGN);
if (buf == NULL)
return (ret);
ptr = buf + ETHER_ALIGN;
diff --git a/stand/i386/libi386/pxe.c b/stand/i386/libi386/pxe.c
index e94c63878284..e80a1961e191 100644
--- a/stand/i386/libi386/pxe.c
+++ b/stand/i386/libi386/pxe.c
@@ -501,7 +501,7 @@ pxe_netif_receive_isr(t_PXENV_UNDI_ISR *isr, void **pkt, ssize_t *retsize)
* multiple GET_NEXT calls.
*/
size = isr->FrameLength;
- buf = memalign(4, size + ETHER_ALIGN);
+ buf = malloc(size + ETHER_ALIGN);
if (buf == NULL)
return (ENOMEM);
diff --git a/stand/libofw/ofw_net.c b/stand/libofw/ofw_net.c
index a037c3defaf5..14494ecc2b2e 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 = memalign(4, len + ETHER_ALIGN);
+ buf = malloc(len + ETHER_ALIGN);
if (buf == NULL)
return (-1);
ptr = buf + ETHER_ALIGN;
diff --git a/stand/uboot/lib/net.c b/stand/uboot/lib/net.c
index 3d0ba5fdc6d3..81b8c5bc9f5b 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 = memalign(4, rlen + ETHER_ALIGN);
+ buf = malloc(rlen + ETHER_ALIGN);
if (buf == NULL)
return (-1);
memcpy(buf + ETHER_ALIGN, sc->sc_rxbuf, rlen);