All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] usb: allow max 8192 bytes for desc
@ 2022-01-11 10:49 zhenwei pi
  2022-01-11 12:07 ` Philippe Mathieu-Daudé
  2022-01-11 12:21 ` Peter Maydell
  0 siblings, 2 replies; 8+ messages in thread
From: zhenwei pi @ 2022-01-11 10:49 UTC (permalink / raw)
  To: kraxel; +Cc: f4bug, zhenwei pi, qemu-devel

A device of USB video class usually uses larger desc structure, so
use larger buffer to avoid failure. (dev-video.c is ready)

Allocating memory dynamically by g_malloc of the orignal version of
this change, Philippe suggested just using the stack. Test the two
versions of qemu binary, the size of stack gets no change.

CC: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: zhenwei pi <pizhenwei@bytedance.com>
---
 hw/usb/desc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/usb/desc.c b/hw/usb/desc.c
index 8b6eaea407..57d2aedba1 100644
--- a/hw/usb/desc.c
+++ b/hw/usb/desc.c
@@ -632,7 +632,7 @@ int usb_desc_get_descriptor(USBDevice *dev, USBPacket *p,
     bool msos = (dev->flags & (1 << USB_DEV_FLAG_MSOS_DESC_IN_USE));
     const USBDesc *desc = usb_device_get_usb_desc(dev);
     const USBDescDevice *other_dev;
-    uint8_t buf[256];
+    uint8_t buf[8192];
     uint8_t type = value >> 8;
     uint8_t index = value & 0xff;
     int flags, ret = -1;
-- 
2.25.1



^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2022-01-11 13:18 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-01-11 10:49 [PATCH] usb: allow max 8192 bytes for desc zhenwei pi
2022-01-11 12:07 ` Philippe Mathieu-Daudé
2022-01-11 12:21 ` Peter Maydell
2022-01-11 12:25   ` Daniel P. Berrangé
2022-01-11 12:27     ` zhenwei pi
2022-01-11 12:38       ` Daniel P. Berrangé
2022-01-11 12:39         ` zhenwei pi
2022-01-11 12:59       ` Philippe Mathieu-Daudé

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.