]> git.baikalelectronics.ru Git - kernel.git/commit
netdevsim: fix overflow on the error path
authorJakub Kicinski <jakub.kicinski@netronome.com>
Sat, 27 Jan 2018 03:50:00 +0000 (19:50 -0800)
committerDaniel Borkmann <daniel@iogearbox.net>
Thu, 1 Feb 2018 10:22:51 +0000 (11:22 +0100)
commit52a47de14678f97d4f4ebd1d16eaf1e4fa5baa7a
treefb307180cdbf3d5b7e73aae639b8eef7a4aa08c0
parentccaac4ff9279bf461d34181103d499c869ee2c93
netdevsim: fix overflow on the error path

Undo loop condition on the error path would cause the i counter
to go below zero, if allocation failure happened with the first
(i.e. 0th) element of the array.

Fixes: c80225d11804 ("netdevsim: bpf: support fake map offload")
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Reviewed-by: Simon Horman <simon.horman@netronome.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
drivers/net/netdevsim/bpf.c