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 */