Message ID | 20200518213737.wQv6yFzC8%akpm@linux-foundation.org |
---|---|
State | New |
Headers | show |
Series | + rapidio-fix-an-error-in-get_user_pages_fast-error-handling.patch added to -mm tree | expand |
--- a/drivers/rapidio/devices/rio_mport_cdev.c~rapidio-fix-an-error-in-get_user_pages_fast-error-handling +++ a/drivers/rapidio/devices/rio_mport_cdev.c @@ -877,6 +877,11 @@ rio_dma_transfer(struct file *filp, u32 rmcd_error("pinned %ld out of %ld pages", pinned, nr_pages); ret = -EFAULT; + /* + * Set nr_pages up to mean "how many pages to unpin, in + * the error handler: + */ + nr_pages = pinned; goto err_pg; }