usb-hub: Fix handling port power control messages
authorGuenter Roeck <linux@roeck-us.net>
Tue, 12 Nov 2024 17:01:52 +0000 (09:01 -0800)
committerPhilippe Mathieu-Daudé <philmd@linaro.org>
Mon, 18 Nov 2024 12:36:39 +0000 (13:36 +0100)
The ClearPortFeature control message fails for PORT_POWER because there
is no break; at the end of the case statement, causing it to fall through
to the failure handler. Add the missing break; to solve the problem.

Fixes: 1cc403eb21 ("usb-hub: emulate per port power switching")
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20241112170152.217664-11-linux@roeck-us.net>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
hw/usb/dev-hub.c

index 06e9537d03562befd95fb8f278c3ee41060a232e..2c3640c7056232d2bd571df3174f0f68397b932a 100644 (file)
@@ -479,6 +479,7 @@ static void usb_hub_handle_control(USBDevice *dev, USBPacket *p,
                     usb_hub_port_clear(port, PORT_STAT_SUSPEND);
                     port->wPortChange = 0;
                 }
+                break;
             default:
                 goto fail;
             }