|
@@ -198,7 +198,7 @@ static u64 bpf_perf_event_read(u64 r1, u64 index, u64 r3, u64 r4, u64 r5)
|
|
if (unlikely(index >= array->map.max_entries))
|
|
if (unlikely(index >= array->map.max_entries))
|
|
return -E2BIG;
|
|
return -E2BIG;
|
|
|
|
|
|
- file = (struct file *)array->ptrs[index];
|
|
|
|
|
|
+ file = READ_ONCE(array->ptrs[index]);
|
|
if (unlikely(!file))
|
|
if (unlikely(!file))
|
|
return -ENOENT;
|
|
return -ENOENT;
|
|
|
|
|
|
@@ -247,7 +247,7 @@ static u64 bpf_perf_event_output(u64 r1, u64 r2, u64 flags, u64 r4, u64 size)
|
|
if (unlikely(index >= array->map.max_entries))
|
|
if (unlikely(index >= array->map.max_entries))
|
|
return -E2BIG;
|
|
return -E2BIG;
|
|
|
|
|
|
- file = (struct file *)array->ptrs[index];
|
|
|
|
|
|
+ file = READ_ONCE(array->ptrs[index]);
|
|
if (unlikely(!file))
|
|
if (unlikely(!file))
|
|
return -ENOENT;
|
|
return -ENOENT;
|
|
|
|
|