Commit 7f8bf6d9 authored by Stephen Lord's avatar Stephen Lord

[XFS] fix a couple of kmem issues, check for OOM in kmem_relalloc more

and in the out of mem case, panic in the sleep case, not the 
non-sleep case.

SGI Modid: 2.5.x-xfs:slinx:140364a
parent 85d22275
......@@ -139,7 +139,7 @@ kmem_alloc(size_t size, int flags)
}
rval = __vmalloc(size, flag_convert(flags), PAGE_KERNEL);
if (!rval && !(flags & KM_SLEEP))
if (!rval && (flags & KM_SLEEP))
panic("kmem_alloc: NULL memory on KM_SLEEP request!");
return rval;
......@@ -176,7 +176,9 @@ kmem_realloc(void *ptr, size_t newsize, size_t oldsize, int flags)
new = kmem_alloc(newsize, flags);
if (ptr) {
memcpy(new, ptr, ((oldsize < newsize) ? oldsize : newsize));
if (new)
memcpy(new, ptr,
((oldsize < newsize) ? oldsize : newsize));
kmem_free(ptr, oldsize);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment