From 95a38c395de8941ee0f3de09006c423773e093b7 Mon Sep 17 00:00:00 2001 From: Thomas Huth Date: Fri, 4 Jan 2019 16:02:26 +0100 Subject: [PATCH 1/2] hw/audio/marvell: Don't include unnecessary i2c.h header file This device does not use I2C, so no need to include the header file here. Signed-off-by: Thomas Huth Message-Id: <1546614146-10525-1-git-send-email-thuth@redhat.com> Signed-off-by: Gerd Hoffmann --- hw/audio/marvell_88w8618.c | 1 - 1 file changed, 1 deletion(-) diff --git a/hw/audio/marvell_88w8618.c b/hw/audio/marvell_88w8618.c index 6600ab4851..035dd76cbf 100644 --- a/hw/audio/marvell_88w8618.c +++ b/hw/audio/marvell_88w8618.c @@ -12,7 +12,6 @@ #include "qemu/osdep.h" #include "hw/sysbus.h" #include "hw/hw.h" -#include "hw/i2c/i2c.h" #include "hw/audio/wm8750.h" #include "audio/audio.h" #include "qapi/error.h" From a7fde1c1706a93c304eb301cc290d71c9426493b Mon Sep 17 00:00:00 2001 From: Gerd Hoffmann Date: Tue, 11 Dec 2018 08:26:49 +0100 Subject: [PATCH 2/2] usb-audio: ignore usb packages with wrong size MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit usb packets with no payload (zero length) seem to happen in practice for whatever reason. Add a check and skip the packet then, otherwise we'll trigger an assert. Reported-by: Leonardo Soares Müller Signed-off-by: Gerd Hoffmann Reviewed-by: Philippe Mathieu-Daudé Message-id: 20181211072649.20700-1-kraxel@redhat.com --- hw/usb/dev-audio.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hw/usb/dev-audio.c b/hw/usb/dev-audio.c index ee43e4914d..28ac7c5165 100644 --- a/hw/usb/dev-audio.c +++ b/hw/usb/dev-audio.c @@ -321,6 +321,9 @@ static int streambuf_put(struct streambuf *buf, USBPacket *p) if (!free) { return 0; } + if (p->iov.size != USBAUDIO_PACKET_SIZE) { + return 0; + } assert(free >= USBAUDIO_PACKET_SIZE); usb_packet_copy(p, buf->data + (buf->prod % buf->size), USBAUDIO_PACKET_SIZE);