lib: unmap full ring buffer
authorFelix Fietkau <nbd@nbd.name>
Sun, 19 Nov 2023 15:11:40 +0000 (16:11 +0100)
committerFelix Fietkau <nbd@nbd.name>
Sun, 19 Nov 2023 15:11:40 +0000 (16:11 +0100)
Signed-off-by: Felix Fietkau <nbd@nbd.name>
lib.c

diff --git a/lib.c b/lib.c
index c545816fe3a9ad9f9401a265b538d8635eaa257f..ec8c23d64da814b2dfca13dd34ca4ebdde0d39ee 100644 (file)
--- a/lib.c
+++ b/lib.c
@@ -525,7 +525,7 @@ void udebug_buf_free(struct udebug_buf *buf)
        if (ctx && ctx->fd.fd >= 0)
                udebug_buf_msg(buf, CL_MSG_RING_REMOVE);
 
-       munmap(buf->hdr, buf->head_size + buf->data_size);
+       munmap(buf->hdr, buf->head_size + 2 * buf->data_size);
        close(buf->fd);
        memset(buf, 0, sizeof(*buf));
 }