]> git.baikalelectronics.ru Git - kernel.git/commit
s390/gup: handle zero nr_pages case correctly
authorHeiko Carstens <heiko.carstens@de.ibm.com>
Tue, 8 Oct 2013 07:29:09 +0000 (09:29 +0200)
committerMartin Schwidefsky <schwidefsky@de.ibm.com>
Thu, 24 Oct 2013 15:17:01 +0000 (17:17 +0200)
commit9c087626f358a27682d87f91084ba973b6da4718
tree68b30c431a0418d31feaca8046a9deab86172b7e
parente5f5eab4dd2fb0cf5fe9f47057d7b24c2d7fb956
s390/gup: handle zero nr_pages case correctly

If [__]get_user_pages_fast() gets called with nr_pages == 0, the current
code would walk the page tables and pin as many pages until the first
invalid pte (or the kernel crashed while writing struct page pointers to
the pages array).
So let's handle at least the nr_pages == 0 case correctly and exit early.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
arch/s390/mm/gup.c