diff options
author | Florian Lehner <dev@der-flo.net> | 2022-10-28 20:34:05 +0200 |
---|---|---|
committer | Martin KaFai Lau <martin.lau@kernel.org> | 2022-10-28 15:45:58 -0700 |
commit | e39e739ab57399f46167d453bbdb8ef8d57c6488 (patch) | |
tree | 4c71035f5de99b1d0d4d921ecb00775beda8add4 /scripts/bpf_doc.py | |
parent | b6d207999c350b19a787e48757f98198d0bf3e5b (diff) |
bpf: check max_entries before allocating memory
For maps of type BPF_MAP_TYPE_CPUMAP memory is allocated first before
checking the max_entries argument. If then max_entries is greater than
NR_CPUS additional work needs to be done to free allocated memory before
an error is returned.
This changes moves the check on max_entries before the allocation
happens.
Signed-off-by: Florian Lehner <dev@der-flo.net>
Link: https://lore.kernel.org/r/20221028183405.59554-1-dev@der-flo.net
Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org>
Diffstat (limited to 'scripts/bpf_doc.py')
0 files changed, 0 insertions, 0 deletions