qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Alon Levy <alevy@redhat.com>
To: Cole Robinson <crobinso@redhat.com>, mlureau@redhat.com
Cc: qemu-devel@nongnu.org, kraxel@redhat.com
Subject: Re: [Qemu-devel] [PATCH] ccid: Fix crash when backend isn't specified
Date: Mon, 15 Apr 2013 11:03:27 +0300	[thread overview]
Message-ID: <1366013007.15187.2.camel@localhost> (raw)
In-Reply-To: <681f15c0b6ac898724d68227f34977b106c7fa59.1365969853.git.crobinso@redhat.com>

On Sun, 2013-04-14 at 16:06 -0400, Cole Robinson wrote:
> Reproducer:
> 
> ./x86_64-softmmu/qemu-system-x86_64 -device usb-ccid,id=ccid0 -usb -device ccid-card-emulated -monitor stdio
> 

ACK, thanks.

Marc-Andre, could you review the fixed patches I sent previously, and
then I can put this on top and send a pull request?

http://lists.nongnu.org/archive/html/qemu-devel/2013-03/msg04927.html

> Signed-off-by: Cole Robinson <crobinso@redhat.com>
> ---
>  hw/usb/ccid-card-emulated.c | 10 ++++++++--
>  1 file changed, 8 insertions(+), 2 deletions(-)
> 
> diff --git a/hw/usb/ccid-card-emulated.c b/hw/usb/ccid-card-emulated.c
> index 29dcd7a..65e1432 100644
> --- a/hw/usb/ccid-card-emulated.c
> +++ b/hw/usb/ccid-card-emulated.c
> @@ -500,9 +500,15 @@ static int emulated_initfn(CCIDCardState *base)
>      if (init_pipe_signaling(card) < 0) {
>          return -1;
>      }
> -    card->backend = parse_enumeration(card->backend_str, backend_enum_table, 0);
> +
> +    card->backend = 0;
> +    if (card->backend_str) {
> +        card->backend = parse_enumeration(card->backend_str,
> +                                          backend_enum_table, 0);
> +    }
> +
>      if (card->backend == 0) {
> -        printf("unknown backend, must be one of:\n");
> +        printf("backend must be one of:\n");
>          for (ptable = backend_enum_table; ptable->name != NULL; ++ptable) {
>              printf("%s\n", ptable->name);
>          }
> -- 
> 1.8.1.4
> 
> 

      reply	other threads:[~2013-04-15  8:03 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-14 20:06 [Qemu-devel] [PATCH] ccid: Fix crash when backend isn't specified Cole Robinson
2013-04-15  8:03 ` Alon Levy [this message]

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=1366013007.15187.2.camel@localhost \
    --to=alevy@redhat.com \
    --cc=crobinso@redhat.com \
    --cc=kraxel@redhat.com \
    --cc=mlureau@redhat.com \
    --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).