Since it is legitimate for pin_user_pages returns 0, which means it might be dead loop here. Signed-off-by: Guoqing Jiang <guoqing.jiang@xxxxxxxxx> --- drivers/infiniband/sw/siw/siw_mem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/infiniband/sw/siw/siw_mem.c b/drivers/infiniband/sw/siw/siw_mem.c index c5f7f1669d09..92c5776a9eed 100644 --- a/drivers/infiniband/sw/siw/siw_mem.c +++ b/drivers/infiniband/sw/siw/siw_mem.c @@ -423,7 +423,7 @@ struct siw_umem *siw_umem_get(u64 start, u64 len, bool writable) while (nents) { rv = pin_user_pages(first_page_va, nents, foll_flags, plist); - if (rv < 0) + if (rv <= 0) goto out_sem_up; umem->num_pages += rv; -- 2.35.3