From 84fcc63a5e35af976b39881305cd13b6b8b875d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Mon, 11 Dec 2006 16:56:23 +0000 Subject: [PATCH] * The temporary buffer was never freed in case it still contained more than one iovec. * Minor cleanup. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19459 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/add-ons/kernel/network/devices/ethernet/ethernet.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/add-ons/kernel/network/devices/ethernet/ethernet.cpp b/src/add-ons/kernel/network/devices/ethernet/ethernet.cpp index afd174a35d..67234647bb 100644 --- a/src/add-ons/kernel/network/devices/ethernet/ethernet.cpp +++ b/src/add-ons/kernel/network/devices/ethernet/ethernet.cpp @@ -139,8 +139,6 @@ dprintf("try to send ethernet packet of %lu bytes (flags %ld):\n", buffer->size, if (gBufferModule->count_iovecs(buffer) > 1) { // TODO: for now, create a new buffer containing the data - net_buffer *original = buffer; - buffer = gBufferModule->duplicate(original); if (buffer == NULL) return ENOBUFS; @@ -149,6 +147,8 @@ dprintf("try to send ethernet packet of %lu bytes (flags %ld):\n", buffer->size, if (gBufferModule->count_iovecs(buffer) > 1) { dprintf("scattered I/O is not yet supported by ethernet device.\n"); + gBufferModule->free(buffer); + device->stats.send.errors++; return B_NOT_SUPPORTED; } }