Xen-Devel Archive mirror
 help / color / mirror / Atom feed
* [patch] net/xen-netback: off by one in BUG_ON() condition
@ 2015-07-11 22:20 Dan Carpenter
  0 siblings, 0 replies; 2+ messages in thread
From: Dan Carpenter @ 2015-07-11 22:20 UTC (permalink / raw
  To: Ian Campbell, Zoltan Kiss; +Cc: xen-devel, kernel-janitors, Wei Liu, netdev

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

Fixes: f53c3fe8dad7 ('xen-netback: Introduce TX grant mapping')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/net/xen-netback/netback.c b/drivers/net/xen-netback/netback.c
index 880d0d6..7d50711 100644
--- a/drivers/net/xen-netback/netback.c
+++ b/drivers/net/xen-netback/netback.c
@@ -1566,13 +1566,13 @@ static inline void xenvif_tx_dealloc_action(struct xenvif_queue *queue)
 		smp_rmb();
 
 		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 =
 				queue->dealloc_ring[pending_index(dc++)];
 
-			pending_idx_release[gop-queue->tx_unmap_ops] =
+			pending_idx_release[gop - queue->tx_unmap_ops] =
 				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];
 			gnttab_set_unmap_op(gop,
 					    idx_to_kaddr(queue, pending_idx),

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [patch] net/xen-netback: off by one in BUG_ON() condition
       [not found] <20150711222055.GA11708@mwanda>
@ 2015-07-14 22:42 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2015-07-14 22:42 UTC (permalink / raw
  To: dan.carpenter
  Cc: wei.liu2, ian.campbell, netdev, kernel-janitors, zoltan.kiss,
	xen-devel

From: Dan Carpenter <dan.carpenter@oracle.com>
Date: Sun, 12 Jul 2015 01:20:55 +0300

> The > should be >=.  I also added spaces around the '-' operations so
> the code is a little more consistent and matches the condition better.
> 
> Fixes: f53c3fe8dad7 ('xen-netback: Introduce TX grant mapping')
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Applied and queued up for -stable, thanks.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-07-14 22:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-11 22:20 [patch] net/xen-netback: off by one in BUG_ON() condition Dan Carpenter
     [not found] <20150711222055.GA11708@mwanda>
2015-07-14 22:42 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).