[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] ccid: Fix crash when backend isn't specified
From: |
Alon Levy |
Subject: |
Re: [Qemu-devel] [PATCH] ccid: Fix crash when backend isn't specified |
Date: |
Mon, 15 Apr 2013 11:03:27 +0300 |
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 <address@hidden>
> ---
> 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
>
>