Inside __scif_pin_pages(), when map_flags != SCIF_MAP_KERNEL it
will call pin_user_pages_fast() to map nr_pages. However,
pin_user_pages_fast() might fail with a return value -ERRNO.
The return value is stored in pinned_pages->nr_pages. which in
turn is passed to unpin_user_pages(), which expects
pinned_pages->nr_pages >=0, else disaster.
Fix this by assigning pinned_pages->nr_pages to 0 if
pin_user_pages_fast() returns -ERRNO.
Fixes:
|
||
|---|---|---|
| .. | ||
| bus | ||
| card | ||
| common | ||
| cosm | ||
| cosm_client | ||
| host | ||
| scif | ||
| vop | ||
| Kconfig | ||
| Makefile | ||