]> git.karo-electronics.de Git - karo-tx-linux.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>
Tue, 15 Oct 2013 12:45:38 +0000 (14:45 +0200)
commitb3cd709feee329ba5dc1a84b553d7b1e2895353c
treeffee47d515e374d7f54a5844b86239cfcbcc4ed4
parentd627cc48457f7ac7f33882f5a4f5b50be99dc8b7
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