mirror of https://gitee.com/openkylin/qemu.git
qga: fix an off-by-one issue
Signed-off-by: Li Qiang <liq3ea@gmail.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
This commit is contained in:
parent
7fae518479
commit
d9c85b6cc5
|
@ -485,7 +485,7 @@ static STORAGE_BUS_TYPE win2qemu[] = {
|
|||
|
||||
static GuestDiskBusType find_bus_type(STORAGE_BUS_TYPE bus)
|
||||
{
|
||||
if (bus > ARRAY_SIZE(win2qemu) || (int)bus < 0) {
|
||||
if (bus >= ARRAY_SIZE(win2qemu) || (int)bus < 0) {
|
||||
return GUEST_DISK_BUS_TYPE_UNKNOWN;
|
||||
}
|
||||
return win2qemu[(int)bus];
|
||||
|
|
Loading…
Reference in New Issue