Message ID | 162621178053.487037.17045908415646631264.stgit@omen (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | [PULL,1/3] vfio: Fix CID 1458134 in vfio_register_ram_discard_listener() | expand |
diff --git a/hw/vfio/common.c b/hw/vfio/common.c index 3f0d11136081..8728d4d5c2e2 100644 --- a/hw/vfio/common.c +++ b/hw/vfio/common.c @@ -783,7 +783,8 @@ static void vfio_register_ram_discard_listener(VFIOContainer *container, section->mr); g_assert(vrdl->granularity && is_power_of_2(vrdl->granularity)); - g_assert(vrdl->granularity >= 1 << ctz64(container->pgsizes)); + g_assert(container->pgsizes && + vrdl->granularity >= 1ULL << ctz64(container->pgsizes)); ram_discard_listener_init(&vrdl->listener, vfio_ram_discard_notify_populate,