diff options
| author | Paolo Bonzini <pbonzini@redhat.com> | 2015-07-14 13:45:34 +0200 |
|---|---|---|
| committer | Paolo Bonzini <pbonzini@redhat.com> | 2015-07-16 20:00:20 +0200 |
| commit | c6742b14fe7352059cd4954a356a8105757af31b (patch) | |
| tree | eae15d976e0f23a28cc004a44ca863ed440cb888 /hw/usb/host-libusb.c | |
| parent | 24b41d66c8ad8f77839fca777b92e365dad0cf5c (diff) | |
| download | focaccia-qemu-c6742b14fe7352059cd4954a356a8105757af31b.tar.gz focaccia-qemu-c6742b14fe7352059cd4954a356a8105757af31b.zip | |
memory: fix refcount leak in memory_region_present
memory_region_present() leaks a reference to a MemoryRegion in the case "mr == container". While fixing it, avoid reference counting altogether for memory_region_present(), by using RCU only. The return value could in principle be already invalid immediately after memory_region_present returns, but presumably the caller knows that and it's using memory_region_present to probe for devices that are unpluggable, or something like that. The RCU critical section is needed anyway, because it protects as->current_map. Reported-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'hw/usb/host-libusb.c')
0 files changed, 0 insertions, 0 deletions