[BUGFIX] readahead: fix NULL filp dereference
diff mbox

Message ID 20100402072750.GA22952@localhost
State New, archived
Headers show

Commit Message

Fengguang Wu April 2, 2010, 7:27 a.m. UTC
None

Patch
diff mbox

--- sound-2.6.orig/mm/readahead.c	2010-03-26 11:51:57.000000000 +0800
+++ sound-2.6/mm/readahead.c	2010-03-26 11:52:11.000000000 +0800
@@ -502,7 +502,7 @@  void page_cache_sync_readahead(struct ad
 		return;
 
 	/* be dumb */
-	if (filp->f_mode & FMODE_RANDOM) {
+	if (filp && (filp->f_mode & FMODE_RANDOM)) {
 		force_page_cache_readahead(mapping, filp, offset, req_size);
 		return;
 	}