Commit 50c2e4dd authored by Dan Carpenter's avatar Dan Carpenter Committed by David S. Miller

net/xen-netback: off by one in BUG_ON() condition

The > should be >=.  I also added spaces around the '-' operations so
the code is a little more consistent and matches the condition better.

Fixes: f53c3fe8 ('xen-netback: Introduce TX grant mapping')
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent f760b87f
...@@ -1566,13 +1566,13 @@ static inline void xenvif_tx_dealloc_action(struct xenvif_queue *queue) ...@@ -1566,13 +1566,13 @@ static inline void xenvif_tx_dealloc_action(struct xenvif_queue *queue)
smp_rmb(); smp_rmb();
while (dc != dp) { while (dc != dp) {
BUG_ON(gop - queue->tx_unmap_ops > MAX_PENDING_REQS); BUG_ON(gop - queue->tx_unmap_ops >= MAX_PENDING_REQS);
pending_idx = pending_idx =
queue->dealloc_ring[pending_index(dc++)]; queue->dealloc_ring[pending_index(dc++)];
pending_idx_release[gop-queue->tx_unmap_ops] = pending_idx_release[gop - queue->tx_unmap_ops] =
pending_idx; pending_idx;
queue->pages_to_unmap[gop-queue->tx_unmap_ops] = queue->pages_to_unmap[gop - queue->tx_unmap_ops] =
queue->mmap_pages[pending_idx]; queue->mmap_pages[pending_idx];
gnttab_set_unmap_op(gop, gnttab_set_unmap_op(gop,
idx_to_kaddr(queue, pending_idx), idx_to_kaddr(queue, pending_idx),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment