linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm/gup: Fix memory leak in __gup_benchmark_ioctl
@ 2019-12-11 17:46 Navid Emamdoost
  2019-12-12 23:14 ` Ira Weiny
  2019-12-13 21:40 ` John Hubbard
  0 siblings, 2 replies; 10+ messages in thread
From: Navid Emamdoost @ 2019-12-11 17:46 UTC (permalink / raw)
  To: Andrew Morton, Kirill A. Shutemov, Keith Busch, linux-mm, linux-kernel
  Cc: emamd001, Navid Emamdoost

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().

Fixes: 714a3a1ebafe ("mm/gup_benchmark.c: add additional pinning methods")
Signed-off-by: Navid Emamdoost <navid.emamdoost@gmail.com>
---
 mm/gup_benchmark.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/mm/gup_benchmark.c b/mm/gup_benchmark.c
index 7dd602d7f8db..b160638f647e 100644
--- a/mm/gup_benchmark.c
+++ b/mm/gup_benchmark.c
@@ -63,6 +63,7 @@ static int __gup_benchmark_ioctl(unsigned int cmd,
 					    NULL);
 			break;
 		default:
+			kvfree(pages);
 			return -1;
 		}
 
-- 
2.17.1



^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2019-12-16 12:18 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-11 17:46 [PATCH] mm/gup: Fix memory leak in __gup_benchmark_ioctl Navid Emamdoost
2019-12-12 23:14 ` Ira Weiny
2019-12-13 21:40 ` John Hubbard
2019-12-13 22:23   ` Andrew Morton
2019-12-13 22:39     ` Navid Emamdoost
2019-12-13 22:37   ` [PATCH v2] " Navid Emamdoost
2019-12-13 23:12     ` Ira Weiny
2019-12-14  0:44     ` John Hubbard
2019-12-14 18:10     ` Markus Elfring
2019-12-16 12:18     ` David Hildenbrand

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox