readahead: fix NULL filp dereference
[linux-2.6.git] / mm / readahead.c
index 999b54b..dfa9a1a 100644 (file)
@@ -503,7 +503,7 @@ void page_cache_sync_readahead(struct address_space *mapping,
                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;
        }