mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-12-11 16:00:50 -07:00
usb-hub: limit chain length
USB supports up to 5 hubs chained. Catch attempts to chain more. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
This commit is contained in:
parent
4b7b2afae7
commit
c24e4aac3b
3 changed files with 9 additions and 0 deletions
|
|
@ -341,8 +341,10 @@ void usb_port_location(USBPort *downstream, USBPort *upstream, int portnr)
|
|||
if (upstream) {
|
||||
snprintf(downstream->path, sizeof(downstream->path), "%s.%d",
|
||||
upstream->path, portnr);
|
||||
downstream->hubcount = upstream->hubcount + 1;
|
||||
} else {
|
||||
snprintf(downstream->path, sizeof(downstream->path), "%d", portnr);
|
||||
downstream->hubcount = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue