Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1714802 > unrolled thread
| Started by | Colin King <colin.king@canonical.com> |
|---|---|
| First post | 2017-08-18 13:20 +0200 |
| Last post | 2017-08-18 19:30 +0200 |
| Articles | 3 — 3 participants |
Back to article view | Back to linux.kernel
[PATCH] nfp: fix infinite loop on umapping cleanup Colin King <colin.king@canonical.com> - 2017-08-18 13:20 +0200
Re: [oss-drivers] [PATCH] nfp: fix infinite loop on umapping cleanup Jakub Kicinski <jakub.kicinski@netronome.com> - 2017-08-18 16:40 +0200
Re: [PATCH] nfp: fix infinite loop on umapping cleanup David Miller <davem@davemloft.net> - 2017-08-18 19:30 +0200
| From | Colin King <colin.king@canonical.com> |
|---|---|
| Date | 2017-08-18 13:20 +0200 |
| Subject | [PATCH] nfp: fix infinite loop on umapping cleanup |
| Message-ID | <ufNtL-2V8-17@gated-at.bofh.it> |
From: Colin Ian King <colin.king@canonical.com>
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>
---
drivers/net/ethernet/netronome/nfp/nfp_net_common.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/netronome/nfp/nfp_net_common.c b/drivers/net/ethernet/netronome/nfp/nfp_net_common.c
index 4a990033c4d5..732f1d315fba 100644
--- a/drivers/net/ethernet/netronome/nfp/nfp_net_common.c
+++ b/drivers/net/ethernet/netronome/nfp/nfp_net_common.c
@@ -908,8 +908,7 @@ static int nfp_net_tx(struct sk_buff *skb, struct net_device *netdev)
return NETDEV_TX_OK;
err_unmap:
- --f;
- while (f >= 0) {
+ while (--f >= 0) {
frag = &skb_shinfo(skb)->frags[f];
dma_unmap_page(dp->dev, tx_ring->txbufs[wr_idx].dma_addr,
skb_frag_size(frag), DMA_TO_DEVICE);
--
2.11.0
[toc] | [next] | [standalone]
| From | Jakub Kicinski <jakub.kicinski@netronome.com> |
|---|---|
| Date | 2017-08-18 16:40 +0200 |
| Subject | Re: [oss-drivers] [PATCH] nfp: fix infinite loop on umapping cleanup |
| Message-ID | <ufQBk-51P-5@gated-at.bofh.it> |
| In reply to | #1714802 |
On Fri, 18 Aug 2017 12:11:50 +0100, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> 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>
Thanks!
[toc] | [prev] | [next] | [standalone]
| From | David Miller <davem@davemloft.net> |
|---|---|
| Date | 2017-08-18 19:30 +0200 |
| Message-ID | <ufTfP-6OC-7@gated-at.bofh.it> |
| In reply to | #1714802 |
From: Colin King <colin.king@canonical.com>
Date: Fri, 18 Aug 2017 12:11:50 +0100
> From: Colin Ian King <colin.king@canonical.com>
>
> 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>
Applied and queued up for -stable.
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web