From: "Jan Beulich" Subject: [PATCH] netfront: fix updating of req_prod_pvt in the receive ring for the flipping case Date: Wed, 04 Jun 2008 08:35:39 +0100 Message-ID: <484661EB.76E4.0078.0@novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Return-path: Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com Cc: Pat Campbell List-Id: xen-devel@lists.xenproject.org From: Pat Campbell 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. Signed-off-by: Jan Beulich Index: head-2008-05-19/drivers/xen/netfront/netfront.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- head-2008-05-19.orig/drivers/xen/netfront/netfront.c 2008-06-04 = 09:12:13.000000000 +0200 +++ head-2008-05-19/drivers/xen/netfront/netfront.c 2008-06-04 = 09:20:50.000000000 +0200 @@ -852,8 +852,8 @@ no_skb: /* Check return status of HYPERVISOR_memory_op(). = */ if (unlikely(np->rx_mcl[i].result !=3D 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_reservatio= n, &reservation) !=3D i)