summaryrefslogtreecommitdiffstats
path: root/hw
diff options
context:
space:
mode:
authorAnthony Liguori <aliguori@us.ibm.com>2013-04-29 08:26:39 -0500
committerAnthony Liguori <aliguori@us.ibm.com>2013-04-29 08:26:39 -0500
commit45dddd90c339254d1ebc34ef719d84f3495c151b (patch)
tree6f8142b9135d94862ac7852d7dbf2df9b064f9b6 /hw
parent903ce9fefacd828bbcadd656ddaed8984139be29 (diff)
parentae12e3a643c66575c77211e1226ada041e56b889 (diff)
downloadhqemu-45dddd90c339254d1ebc34ef719d84f3495c151b.zip
hqemu-45dddd90c339254d1ebc34ef719d84f3495c151b.tar.gz
Merge remote-tracking branch 'alon/libcacard_ccid.2' into staging
# By Cole Robinson # Via Alon Levy * alon/libcacard_ccid.2: ccid: Fix crash when backend isn't specified Message-id: 20130426234357.GA12457@garlic.tami Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw')
-rw-r--r--hw/usb/ccid-card-emulated.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/hw/usb/ccid-card-emulated.c b/hw/usb/ccid-card-emulated.c
index 094284d..deb6d47 100644
--- a/hw/usb/ccid-card-emulated.c
+++ b/hw/usb/ccid-card-emulated.c
@@ -503,9 +503,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);
}
OpenPOWER on IntegriCloud