]> 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, 22 Oct 2013 07:18:18 +0000 (09:18 +0200)
commit44c78373ef146fcca050f97414e9db1d056354df
tree359045c2fbb42338ecdb326eb900a09c78fe3d6f
parent0581414324d0ff15ac6b7ff7c50c8888f0f69993
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