]> git.baikalelectronics.ru Git - kernel.git/commit
net: filter: Use kcalloc/kmalloc_array to allocate arrays
authorTobias Klauser <tklauser@distanz.ch>
Tue, 24 Jun 2014 13:33:22 +0000 (15:33 +0200)
committerDavid S. Miller <davem@davemloft.net>
Wed, 25 Jun 2014 23:40:02 +0000 (16:40 -0700)
commitcce6db4064fe7352eca9a671cf2d7c919d1b3578
tree1517dd11ff7021cb4d06dcd335edd2d8009294d0
parent1cd4c96d5427ab8900145bb58a243c302d2e91eb
net: filter: Use kcalloc/kmalloc_array to allocate arrays

Use kcalloc/kmalloc_array to make it clear we're allocating arrays. No
integer overflow can actually happen here, since len/flen is guaranteed
to be less than BPF_MAXINSNS (4096). However, this changed makes sure
we're not going to get one if BPF_MAXINSNS were ever increased.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Acked-by: Daniel Borkmann <dborkman@redhat.com>
Acked-by: Alexei Starovoitov <ast@plumgrid.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/filter.c