]> git.baikalelectronics.ru Git - kernel.git/commit
nfp: check idx is -ENOSPC before using it is an index
authorColin Ian King <colin.king@canonical.com>
Mon, 11 Jul 2016 15:54:20 +0000 (16:54 +0100)
committerDavid S. Miller <davem@davemloft.net>
Mon, 11 Jul 2016 20:52:00 +0000 (13:52 -0700)
commitee93ee805d78b40b1d61af00012b85786a319269
tree24947099e752bc6645cf73a6e9ab09e2ee605726
parentcdf523e1369429fe599741dc186674c4bf3b4ae8
nfp: check idx is -ENOSPC before using it is an index

idx can be returned as -ENOSPC, so we should check for this first
before using it as an index into nn->vxlan_usecnt[] to avoid an
out of bounds array offset read.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Acked-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/netronome/nfp/nfp_net_common.c