Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
mm/gup: fix memory leak in __gup_benchmark_ioctl
In the implementation of __gup_benchmark_ioctl() the allocated pages should be released before returning in case of an invalid cmd. Release pages via kvfree(). [[email protected]: rework code flow, return -EINVAL rather than -1] Link: http://lkml.kernel.org/r/[email protected] Fixes: 714a3a1 ("mm/gup_benchmark.c: add additional pinning methods") Signed-off-by: Navid Emamdoost <[email protected]> Reviewed-by: Andrew Morton <[email protected]> Reviewed-by: Ira Weiny <[email protected]> Reviewed-by: John Hubbard <[email protected]> Cc: Keith Busch <[email protected]> Cc: Kirill A. Shutemov <[email protected]> Cc: Dave Hansen <[email protected]> Cc: Dan Williams <[email protected]> Cc: David Hildenbrand <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
- Loading branch information