This is an automated email from the ASF dual-hosted git repository.

acassis pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit 67b126c85d3ef627cad71921cd1bb263ead5fc02
Author: wangyongrong <[email protected]>
AuthorDate: Tue Jul 7 17:13:44 2026 +0800

    drivers/virtio-serial: allocate the ring buffers without zeroing
    
    The serial rx/xmit uart ring buffers were allocated with
    virtio_zalloc_buf, which memsets the whole buffer at probe time. The
    ring only ever reads back bytes it has written (tx sends [tail, head),
    rx reads what the device filled), so it does not rely on zero
    initialization. Switch to virtio_malloc_buf to drop the redundant
    per-device memset.
    
    Signed-off-by: wangyongrong <[email protected]>
---
 drivers/virtio/virtio-serial.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/virtio/virtio-serial.c b/drivers/virtio/virtio-serial.c
index 1b2786687cc..0c521290893 100644
--- a/drivers/virtio/virtio-serial.c
+++ b/drivers/virtio/virtio-serial.c
@@ -477,7 +477,7 @@ static int virtio_serial_init(FAR struct 
virtio_serial_priv_s *priv,
   udev->priv        = priv;
   udev->ops         = &g_virtio_serial_ops;
   udev->recv.size   = CONFIG_DRIVERS_VIRTIO_SERIAL_BUFSIZE;
-  udev->recv.buffer = virtio_zalloc_buf(vdev, udev->recv.size, 16);
+  udev->recv.buffer = virtio_malloc_buf(vdev, udev->recv.size, 16);
   if (udev->recv.buffer == NULL)
     {
       vrterr("No enough memory\n");
@@ -485,7 +485,7 @@ static int virtio_serial_init(FAR struct 
virtio_serial_priv_s *priv,
     }
 
   udev->xmit.size   = CONFIG_DRIVERS_VIRTIO_SERIAL_BUFSIZE;
-  udev->xmit.buffer = virtio_zalloc_buf(vdev, udev->xmit.size, 16);
+  udev->xmit.buffer = virtio_malloc_buf(vdev, udev->xmit.size, 16);
   if (udev->xmit.buffer == NULL)
     {
       vrterr("No enough memory\n");

Reply via email to