qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Martin Kletzander <mkletzan@redhat.com>
To: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Cc: peter.maydell@linaro.org, edgari@xilinx.com, mjt@tls.msk.ru,
	qemu-devel@nongnu.org, dgilbert@redhat.com
Subject: Re: [Qemu-devel] [PATCH bugfix v1 1/1] char/serial: Fix emptyness check
Date: Tue, 11 Feb 2014 11:25:52 +0100	[thread overview]
Message-ID: <20140211102549.GB13232@wheatley> (raw)
In-Reply-To: <153a8e98437c7d4b7fc3df2bf375fbc9e0bdb8ef.1392101145.git.peter.crosthwaite@xilinx.com>

[-- Attachment #1: Type: text/plain, Size: 991 bytes --]

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 <peter.crosthwaite@xilinx.com>
> ---

Reviewed-by: Martin Kletzander <mkletzan@redhat.com>

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
>

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

  parent reply	other threads:[~2014-02-11 10:26 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-11  6:49 [Qemu-devel] [PATCH bugfix v1 1/1] char/serial: Fix emptyness check Peter Crosthwaite
2014-02-11  9:55 ` Dr. David Alan Gilbert
2014-02-11 12:38   ` [Qemu-devel] [PATCH bugfix v1 1/1] char/serial: Fix emptynesscheckk Alex Bennée
2014-02-11 12:41     ` Dr. David Alan Gilbert
2014-02-11 10:25 ` Martin Kletzander [this message]
2014-02-11 10:29 ` [Qemu-devel] [PATCH bugfix v1 1/1] char/serial: Fix emptyness check Michael Tokarev

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140211102549.GB13232@wheatley \
    --to=mkletzan@redhat.com \
    --cc=dgilbert@redhat.com \
    --cc=edgari@xilinx.com \
    --cc=mjt@tls.msk.ru \
    --cc=peter.crosthwaite@xilinx.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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 NNTP newsgroup(s).