Use autofree heap allocation instead of variable-length array on the stack.
Signed-off-by: Philippe Mathieu-Daudé <phi...@redhat.com> --- hw/usb/hcd-xhci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/usb/hcd-xhci.c b/hw/usb/hcd-xhci.c index 7acfb8137bc..59a267e3c8b 100644 --- a/hw/usb/hcd-xhci.c +++ b/hw/usb/hcd-xhci.c @@ -2387,7 +2387,7 @@ static void xhci_detach_slot(XHCIState *xhci, USBPort *uport) static TRBCCode xhci_get_port_bandwidth(XHCIState *xhci, uint64_t pctx) { dma_addr_t ctx; - uint8_t bw_ctx[xhci->numports+1]; + g_autofree uint8_t *bw_ctx = g_malloc(xhci->numports + 1); DPRINTF("xhci_get_port_bandwidth()\n"); -- 2.26.3