All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] ramfs/nommu: fix bug - kernel crash when (nr != lpages)
@ 2009-01-07 16:30 Bryan Wu
  2009-01-08 10:58 ` David Howells
  0 siblings, 1 reply; 2+ messages in thread
From: Bryan Wu @ 2009-01-07 16:30 UTC (permalink / raw)
  To: dhowells; +Cc: linux-kernel, akpm, Graf Yang, Bryan Wu

From: Graf Yang <graf.yang@analog.com>

Avoiding kernel crash when (nr != lpages), and return -ENOMEM,
let the user space application handle this error.

Signed-off-by: Graf Yang <graf.yang@analog.com>
Signed-off-by: Bryan Wu <cooloney@kernel.org>
---
 fs/ramfs/file-nommu.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/fs/ramfs/file-nommu.c b/fs/ramfs/file-nommu.c
index 76acdbc..9311031 100644
--- a/fs/ramfs/file-nommu.c
+++ b/fs/ramfs/file-nommu.c
@@ -283,7 +283,8 @@ unsigned long ramfs_nommu_get_unmapped_area(struct file *file,
 	if (pages) {
 		ptr = pages;
 		for (loop = lpages; loop > 0; loop--)
-			put_page(*ptr++);
+			if (*ptr)
+				put_page(*ptr++);
 		kfree(pages);
 	}
 
-- 
1.5.6


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-01-08 10:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-07 16:30 [PATCH 1/1] ramfs/nommu: fix bug - kernel crash when (nr != lpages) Bryan Wu
2009-01-08 10:58 ` David Howells

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.