From 184bbe142aa0cfe33957d1fd3760a9087d2d0ac6 Mon Sep 17 00:00:00 2001 From: Miles Bader Date: Thu, 29 Aug 1996 20:53:43 +0000 Subject: (get_page_buf): Return 0 if we can't allocate. --- ext2fs/ext2fs.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'ext2fs') diff --git a/ext2fs/ext2fs.c b/ext2fs/ext2fs.c index f3e61873..ea0dfe7d 100644 --- a/ext2fs/ext2fs.c +++ b/ext2fs/ext2fs.c @@ -215,8 +215,11 @@ vm_address_t get_page_buf () buf = free_page_bufs; if (buf == 0) { + error_t err; spin_unlock (&free_page_bufs_lock); - vm_allocate (mach_task_self (), &buf, vm_page_size, 1); + err = vm_allocate (mach_task_self (), &buf, vm_page_size, 1); + if (err) + buf = 0; } else { -- cgit v1.2.3