From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33279) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WDAXX-0008It-TV for qemu-devel@nongnu.org; Tue, 11 Feb 2014 05:26:12 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WDAXS-0007WB-Tu for qemu-devel@nongnu.org; Tue, 11 Feb 2014 05:26:07 -0500 Received: from mx1.redhat.com ([209.132.183.28]:21065) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WDAXS-0007VG-Mc for qemu-devel@nongnu.org; Tue, 11 Feb 2014 05:26:02 -0500 Date: Tue, 11 Feb 2014 11:25:52 +0100 From: Martin Kletzander Message-ID: <20140211102549.GB13232@wheatley> References: <153a8e98437c7d4b7fc3df2bf375fbc9e0bdb8ef.1392101145.git.peter.crosthwaite@xilinx.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="6sX45UoQRIJXqkqR" Content-Disposition: inline In-Reply-To: <153a8e98437c7d4b7fc3df2bf375fbc9e0bdb8ef.1392101145.git.peter.crosthwaite@xilinx.com> Subject: Re: [Qemu-devel] [PATCH bugfix v1 1/1] char/serial: Fix emptyness check List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Crosthwaite Cc: peter.maydell@linaro.org, edgari@xilinx.com, mjt@tls.msk.ru, qemu-devel@nongnu.org, dgilbert@redhat.com --6sX45UoQRIJXqkqR Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Mon, Feb 10, 2014 at 10:49:35PM -0800, Peter Crosthwaite wrote: > This was guarding against a full fifo rather than an empty fifo when > popping. Fix. > > Signed-off-by: Peter Crosthwaite > --- Reviewed-by: Martin Kletzander With this patch qemu doesn't crash in my use-case. > > hw/char/serial.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/hw/char/serial.c b/hw/char/serial.c > index 27dab7d..6d3b5af 100644 > --- a/hw/char/serial.c > +++ b/hw/char/serial.c > @@ -225,7 +225,7 @@ static gboolean serial_xmit(GIOChannel *chan, GIOCondition cond, void *opaque) > > if (s->tsr_retry <= 0) { > if (s->fcr & UART_FCR_FE) { > - s->tsr = fifo8_is_full(&s->xmit_fifo) ? > + s->tsr = fifo8_is_empty(&s->xmit_fifo) ? > 0 : fifo8_pop(&s->xmit_fifo); > if (!s->xmit_fifo.num) { > s->lsr |= UART_LSR_THRE; > -- > 1.8.5.4 > --6sX45UoQRIJXqkqR Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) iQIcBAEBAgAGBQJS+fqtAAoJEAgfwp8kF4bdJfIP/0MPN+NpupoSWweo2nvnYMvu KGMvEKJcdOtxpzczRWI4uf/eWkZ7gyTQ6aQZ+PjUH1vF//XHFdeY/uQlIcQ1UdjR KlcyTknl1zcmQQTSX+NL69RN/uNzNttzuKhv9UhJMHYkCGYbnfNAk3WUT2TJFA8Z sOaLwQDmLjoMzSgkg94pV3VdxGnu5KxHdh+DH41ti2UTV96SeCEAsPSqBSA2fnYx sLceO+A+gbiZLmj8yYFsxlEgVKs744k9V66bQyOc1/pdUahv1KXX2hhfV39VoSVQ 9xGTRlSRYVHN9rMSW+dU+g8bSi6Cds1xSXe8BhkgQtf3d86dirJvchrWrTt8l5wN gJ9bTPWh5bZmaPFW9WA3co9ITbYvexS26O2Uyl0wiYw3Ea6nBO0tPOB6mMeUWgSq +zHcfoJpIqMDbCph/WVdFJFXJUexEVk4mor4EzJlDUNpJzvWK3MGC+cJzY2Tvewl fRyIrYV59IcUdnFYrbqABpUAzo2bVvQ6MOJ4stt6sIT7/ju+cn3wQd/dwu4PqRmb s8UdgC76H6tbriWMWS0Fz276orxNhStUuPT35J3Qq93LA97dKMgMEHLGUYenTAUV NkhAl0qwCDAbKx+IAeYsI+oX4A0XFyQhAZ0DiMqACg0aoxuxHQdf3BAlU9wxUOy1 22tAMpexym8eXblGEtCF =bEde -----END PGP SIGNATURE----- --6sX45UoQRIJXqkqR--