[PATCH] rheap.c rh_alloc_fixed

From
Rune Torgersen <hidden>
Date
2005-08-29 22:43:37
rh_alloc_fixed() used by cpm_dpalloc_fixed incorrectly returned next
free area=20
if the requested fixed area is not available.
This fixes it to return an error if requested area is not available.

Signed-off-by Rune Torgersen [off-list ref]

Index: linux-innsys/arch/ppc/lib/rheap.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- linux-innsys/arch/ppc/lib/rheap.c	(revision 29)
+++ linux-innsys/arch/ppc/lib/rheap.c	(working copy)
@@ -522,6 +522,10 @@
 	if (blk =3D=3D NULL)
 		return ERR_PTR(-ENOMEM);
=20
+	/* make sure block actually fits */
+	if (bs > s )=20
+		return ERR_PTR(-ENOMEM);
+
 	/* Perfect fit */
 	if (bs =3D=3D s && be =3D=3D e) {
 		/* Move from free list to taken list */
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help