]> git.proxmox.com Git - qemu.git/blobdiff - bt-host.c
usb: split packet result into actual_length + status
[qemu.git] / bt-host.c
index 6931e7cc62a9d000d5738cd3f33dd49100be2257..0d3ad28e8c0c567eec70016e7acb00e4d641c3dc 100644 (file)
--- a/bt-host.c
+++ b/bt-host.c
@@ -19,7 +19,6 @@
 
 #include "qemu-common.h"
 #include "qemu-char.h"
-#include "sysemu.h"
 #include "net.h"
 #include "bt-host.h"
 
@@ -131,6 +130,7 @@ static void bt_host_read(void *opaque)
             pktlen = MIN(pkt[2] + 3, s->len);
             s->len -= pktlen;
             pkt += pktlen;
+            break;
 
         default:
         bad_pkt:
@@ -178,7 +178,7 @@ struct HCIInfo *bt_host_hci(const char *id)
     }
 # endif
 
-    s = qemu_mallocz(sizeof(struct bt_host_hci_s));
+    s = g_malloc0(sizeof(struct bt_host_hci_s));
     s->fd = fd;
     s->hci.cmd_send = bt_host_cmd;
     s->hci.sco_send = bt_host_sco;