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)
commiteac2c68d663effb077210218788952b5a0c1f60e
treefcd5bc7f3dd1f73d6f767626de623b55eaf8cd36
parentacc8b31665b4cc17b35c4fa445427f7e2f6dc86b
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: 4c3523623dc0 ("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