Merge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma
[sfrench/cifs-2.6.git] / drivers / infiniband / hw / usnic / usnic_uiom.c
index e312f522a66de7a3e333d931955474bcaf907916..0b0237d41613fc4cb61ba4f1cd02430aeda74490 100644 (file)
@@ -75,9 +75,10 @@ static void usnic_uiom_put_pages(struct list_head *chunk_list, int dirty)
                for_each_sg(chunk->page_list, sg, chunk->nents, i) {
                        page = sg_page(sg);
                        pa = sg_phys(sg);
-                       if (!PageDirty(page) && dirty)
-                               set_page_dirty_lock(page);
-                       put_page(page);
+                       if (dirty)
+                               put_user_pages_dirty_lock(&page, 1);
+                       else
+                               put_user_page(page);
                        usnic_dbg("pa: %pa\n", &pa);
                }
                kfree(chunk);