Title: [5813] trunk/fs/ramfs/file-nommu.c: Avoiding kernel crash when (nr != lpages), and return -ENOMEM, let the user space application handle this error.
Revision
5813
Author
gyang
Date
2008-12-04 05:00:38 -0600 (Thu, 04 Dec 2008)

Log Message

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

Modified Paths

Diff

Modified: trunk/fs/ramfs/file-nommu.c (5812 => 5813)


--- trunk/fs/ramfs/file-nommu.c	2008-12-04 09:39:39 UTC (rev 5812)
+++ trunk/fs/ramfs/file-nommu.c	2008-12-04 11:00:38 UTC (rev 5813)
@@ -283,7 +283,8 @@
 	if (pages) {
 		ptr = pages;
 		for (loop = lpages; loop > 0; loop--)
-			put_page(*ptr++);
+			if (*ptr)
+				put_page(*ptr++);
 		kfree(pages);
 	}
 
_______________________________________________
Linux-kernel-commits mailing list
[email protected]
http://blackfin.uclinux.org/mailman/listinfo/linux-kernel-commits

Reply via email to