From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:37567) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UReNx-0005Hp-NJ for qemu-devel@nongnu.org; Mon, 15 Apr 2013 04:03:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UReNw-0008Ex-9l for qemu-devel@nongnu.org; Mon, 15 Apr 2013 04:03:33 -0400 Received: from mx1.redhat.com ([209.132.183.28]:18512) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UReNw-0008Ej-3M for qemu-devel@nongnu.org; Mon, 15 Apr 2013 04:03:32 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r3F83Uru003154 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 15 Apr 2013 04:03:30 -0400 Message-ID: <1366013007.15187.2.camel@localhost> From: Alon Levy Date: Mon, 15 Apr 2013 11:03:27 +0300 In-Reply-To: <681f15c0b6ac898724d68227f34977b106c7fa59.1365969853.git.crobinso@redhat.com> References: <681f15c0b6ac898724d68227f34977b106c7fa59.1365969853.git.crobinso@redhat.com> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] ccid: Fix crash when backend isn't specified List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Cole Robinson , mlureau@redhat.com Cc: qemu-devel@nongnu.org, kraxel@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 > --- > 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 > >