File tree Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Original file line number Diff line number Diff line change @@ -149,11 +149,10 @@ get_bpf_prog_info_linear(int fd, __u64 arrays)
149
149
count = bpf_prog_info_read_offset_u32 (& info , desc -> count_offset );
150
150
size = bpf_prog_info_read_offset_u32 (& info , desc -> size_offset );
151
151
152
- data_len += count * size ;
152
+ data_len += roundup ( count * size , sizeof ( __u64 )) ;
153
153
}
154
154
155
155
/* step 3: allocate continuous memory */
156
- data_len = roundup (data_len , sizeof (__u64 ));
157
156
info_linear = malloc (sizeof (struct perf_bpil ) + data_len );
158
157
if (!info_linear )
159
158
return ERR_PTR (- ENOMEM );
@@ -180,7 +179,7 @@ get_bpf_prog_info_linear(int fd, __u64 arrays)
180
179
bpf_prog_info_set_offset_u64 (& info_linear -> info ,
181
180
desc -> array_offset ,
182
181
ptr_to_u64 (ptr ));
183
- ptr += count * size ;
182
+ ptr += roundup ( count * size , sizeof ( __u64 )) ;
184
183
}
185
184
186
185
/* step 5: call syscall again to get required arrays */
You can’t perform that action at this time.
0 commit comments