diff --git a/mm/nommu.c b/mm/nommu.c index b624acec6d2e..38c22ea0a95c 100644 --- a/mm/nommu.c +++ b/mm/nommu.c @@ -719,7 +719,7 @@ static int validate_mmap_request(struct file *file, if (file) { /* files must support mmap */ - if (!file->f_op->mmap) + if (!file_has_valid_mmap_hooks(file)) return -ENODEV; /* work out if what we've got could possibly be shared