]> git.baikalelectronics.ru Git - kernel.git/commit
nfp: fix infinite loop on umapping cleanup
authorColin Ian King <colin.king@canonical.com>
Fri, 18 Aug 2017 11:11:50 +0000 (12:11 +0100)
committerDavid S. Miller <davem@davemloft.net>
Fri, 18 Aug 2017 17:28:06 +0000 (10:28 -0700)
commit6352275c63f0de96c291c5960678ad86bd8252c4
treefcd5bc7f3dd1f73d6f767626de623b55eaf8cd36
parentd039b00a5812eaaa7c708f773f1388ebf4d733cc
nfp: fix infinite loop on umapping cleanup

The while loop that performs the dma page unmapping never decrements
index counter f and hence loops forever. Fix this with a pre-decrement
on f.

Detected by CoverityScan, CID#1357309 ("Infinite loop")

Fixes: ea083d80703d ("net: add driver for Netronome NFP4000/NFP6000 NIC VFs")
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