]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - mm/memory.c
Be more robust about bad arguments in get_user_pages()
[linux-2.6-omap-h63xx.git] / mm / memory.c
index e5628a5fd678ff2b8faa02521e49cec4d769970e..717aa0e3be2d7d9b0385411257a89d50f6ea3afc 100644 (file)
@@ -989,6 +989,8 @@ int get_user_pages(struct task_struct *tsk, struct mm_struct *mm,
        int i;
        unsigned int vm_flags;
 
+       if (len <= 0)
+               return 0;
        /* 
         * Require read or write permissions.
         * If 'force' is set, we only require the "MAY" flags.