62c3270489
[ Upstream commit a81072a9c0ae734b7889929b0bc070fe3f353f0e ]
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:
|
||
---|---|---|
.. | ||
Makefile | ||
scif_api.c | ||
scif_debugfs.c | ||
scif_dma.c | ||
scif_epd.c | ||
scif_epd.h | ||
scif_fd.c | ||
scif_fence.c | ||
scif_main.c | ||
scif_main.h | ||
scif_map.h | ||
scif_mmap.c | ||
scif_nm.c | ||
scif_nodeqp.c | ||
scif_nodeqp.h | ||
scif_peer_bus.c | ||
scif_peer_bus.h | ||
scif_ports.c | ||
scif_rb.c | ||
scif_rb.h | ||
scif_rma.c | ||
scif_rma.h | ||
scif_rma_list.c | ||
scif_rma_list.h |