diff options
author | Petri Latvala <petri.latvala@intel.com> | 2019-01-16 13:20:36 +0200 |
---|---|---|
committer | Petri Latvala <petri.latvala@intel.com> | 2019-01-28 15:40:28 +0200 |
commit | 15fc7c9de886d684cdaf37316de0b39a5d64f2d9 (patch) | |
tree | 2a7e307a1655e4ed7d75359d28ca8dd10e07b753 /overlay | |
parent | 4a94878797999d1d2f7d224c6cf2e2855cd3109a (diff) |
overlay: Write out the assumption for kernel-provided data
The code assumes (correctly) that perf_event_header's size is
non-zero. Write that out so static analysis also knows it.
Signed-off-by: Petri Latvala <petri.latvala@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
Diffstat (limited to 'overlay')
-rw-r--r-- | overlay/gpu-perf.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/overlay/gpu-perf.c b/overlay/gpu-perf.c index 5629f826..7addd78d 100644 --- a/overlay/gpu-perf.c +++ b/overlay/gpu-perf.c @@ -494,6 +494,7 @@ int gpu_perf_update(struct gpu_perf *gp) const struct perf_event_header *header; header = (const struct perf_event_header *)(data + (tail & mask)); + assert(header->size > 0); if (header->size > head - tail) break; |