Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 11 Feb 2003 11:23:30 +0100 (CET)
From:      Harti Brandt <brandt@fokus.fraunhofer.de>
To:        atm@freebsd.org
Subject:   Bug in hea driver?
Message-ID:  <20030211112002.S3497@beagle.fokus.gmd.de>

index | next in thread | raw e-mail

[-- Attachment #1 --]

Hi all,

could someone please comment on the attached patch? There seems to be a
bug in the on-card memory allocator. The problem is, that when we need to
split a block that appears to be large enough because of alignment, we
want to check, that what remains after splitting is large enough (with
regard to the size we are trying to allocated), not that it is >= 0. The
test for >= 0 should always be true, because a block of size N (N beeing a
power of two) always contains an address that is aligned to N, so that the
upper half when splitting such a block is always >= 0.

harti

-- 
harti brandt, http://www.fokus.gmd.de/research/cc/cats/employees/hartmut.brandt/private
              brandt@fokus.fraunhofer.de, harti@freebsd.org
[-- Attachment #2 --]
Index: eni_buffer.c
===================================================================
RCS file: /home/ncvs/src/sys/dev/hea/eni_buffer.c,v
retrieving revision 1.15
diff -u -r1.15 eni_buffer.c
--- eni_buffer.c	8 Nov 2002 18:27:28 -0000	1.15
+++ eni_buffer.c	11 Feb 2003 10:19:58 -0000
@@ -267,7 +267,7 @@
 		    /*
 		     * If we use this alignment, will it still fit?
 		     */
-		    if ( (eptr->size - (nbase - eptr->base)) >= 0 )
+		    if ( (eptr->size - (nbase - eptr->base)) >= nsize )
 		    {
 			Mbd	*etmp;
 
help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030211112002.S3497>