We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 941f762 commit a7c46c0Copy full SHA for a7c46c0
mm/gup_benchmark.c
@@ -26,6 +26,7 @@ static int __gup_benchmark_ioctl(unsigned int cmd,
26
unsigned long i, nr_pages, addr, next;
27
int nr;
28
struct page **pages;
29
+ int ret = 0;
30
31
if (gup->size > ULONG_MAX)
32
return -EINVAL;
@@ -63,7 +64,9 @@ static int __gup_benchmark_ioctl(unsigned int cmd,
63
64
NULL);
65
break;
66
default:
- return -1;
67
+ kvfree(pages);
68
+ ret = -EINVAL;
69
+ goto out;
70
}
71
72
if (nr <= 0)
@@ -85,7 +88,8 @@ static int __gup_benchmark_ioctl(unsigned int cmd,
85
88
gup->put_delta_usec = ktime_us_delta(end_time, start_time);
86
89
87
90
kvfree(pages);
- return 0;
91
+out:
92
+ return ret;
93
94
95
static long gup_benchmark_ioctl(struct file *filep, unsigned int cmd,
0 commit comments