Skip to content

Commit

Permalink
drivers/firewire/core-iso.c: convert to use vm_map_pages_zero()
Browse files Browse the repository at this point in the history
Convert to use vm_map_pages_zero() to map range of kernel memory to user
vma.

This driver has ignored vm_pgoff and mapped the entire pages.  We could
later "fix" these drivers to behave according to the normal vm_pgoff
offsetting simply by removing the _zero suffix on the function name and if
that causes regressions, it gives us an easy way to revert.

Link: http://lkml.kernel.org/r/88645f5ea8202784a8baaf389e592aeb8c505e8e.1552921225.git.jrdr.linux@gmail.com
Signed-off-by: Souptick Joarder <[email protected]>
Cc: Boris Ostrovsky <[email protected]>
Cc: David Airlie <[email protected]>
Cc: Heiko Stuebner <[email protected]>
Cc: Joerg Roedel <[email protected]>
Cc: Joonsoo Kim <[email protected]>
Cc: Juergen Gross <[email protected]>
Cc: Kees Cook <[email protected]>
Cc: "Kirill A. Shutemov" <[email protected]>
Cc: Kyungmin Park <[email protected]>
Cc: Marek Szyprowski <[email protected]>
Cc: Matthew Wilcox <[email protected]>
Cc: Mauro Carvalho Chehab <[email protected]>
Cc: Michal Hocko <[email protected]>
Cc: Mike Rapoport <[email protected]>
Cc: Oleksandr Andrushchenko <[email protected]>
Cc: Pawel Osciak <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Rik van Riel <[email protected]>
Cc: Robin Murphy <[email protected]>
Cc: Russell King <[email protected]>
Cc: Sandy Huang <[email protected]>
Cc: Stefan Richter <[email protected]>
Cc: Stephen Rothwell <[email protected]>
Cc: Thierry Reding <[email protected]>
Cc: Vlastimil Babka <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Souptick Joarder authored and torvalds committed May 14, 2019
1 parent 6248461 commit 22660db
Showing 1 changed file with 2 additions and 13 deletions.
15 changes: 2 additions & 13 deletions drivers/firewire/core-iso.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,19 +107,8 @@ EXPORT_SYMBOL(fw_iso_buffer_init);
int fw_iso_buffer_map_vma(struct fw_iso_buffer *buffer,
struct vm_area_struct *vma)
{
unsigned long uaddr;
int i, err;

uaddr = vma->vm_start;
for (i = 0; i < buffer->page_count; i++) {
err = vm_insert_page(vma, uaddr, buffer->pages[i]);
if (err)
return err;

uaddr += PAGE_SIZE;
}

return 0;
return vm_map_pages_zero(vma, buffer->pages,
buffer->page_count);
}

void fw_iso_buffer_destroy(struct fw_iso_buffer *buffer,
Expand Down

0 comments on commit 22660db

Please sign in to comment.