On 221115 1119, Peter Xu wrote: > On Fri, Oct 28, 2022 at 03:16:42PM -0400, Alexander Bulekov wrote: > > + /* Do not allow more than one simultanous access to a device's IO > > Regions */ > > + if (mr->owner && > > + !mr->ram_device && !mr->ram && !mr->rom_device && > > !mr->readonly) { > > + dev = (DeviceState *) object_dynamic_cast(mr->owner, TYPE_DEVICE); > > + if (dev->mem_reentrancy_guard.engaged_in_io) { > > Do we need to check dev being non-NULL? Fundamentally it's about whether > the owner can be not a DeviceState, I believe it's normally true but I > can't tell; at least from memory region API it can be any Object*. >
I'll add a NULL-check Thanks