Skip to contentSkip to conversation

netfront: fix updating of req_prod_pvt in the receive ring for the flipping case

PATCH New Jan Beulich 1 participant 1 message Jun 4, 2008 Xen hypervisor interface

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 netfront: fix updating of req_prod_pvt in the receive ring for the flipping case

From: Pat Campbell <[email protected]>

While obsolete, it still shouldn't be left broken.

(Adjusted to not use an extra variable.)

As usual, written on 2.6.25.4 and made apply to the 2.6.18 tree without further testing.

drivers/xen/netfront/netfront.c +2 -2
Index: head-2008-05-19/drivers/xen/netfront/netfront.c
===================================================================
@@ -852,8 +852,8 @@ no_skb:
 			/* Check return status of HYPERVISOR_memory_op(). */
 			if (unlikely(np->rx_mcl[i].result != i))
 				panic("Unable to reduce memory reservation\n");
-			while (i--)
-				BUG_ON(np->rx_mcl[i].result);
+			while (nr_flips--)
+				BUG_ON(np->rx_mcl[nr_flips].result);
 		} else {
 			if (HYPERVISOR_memory_op(XENMEM_decrease_reservation,
 						 &reservation) != i)