On Mon, Jul 04, 2022 at 12:07:36PM -0300, Jason Gunthorpe wrote: > I think the kobject_put() needs to be after this reference to parent > because mdev_type_release() will: > > put_device(type->parent->dev); > > Which is potentially the last reference holding dev, and thus parent, > at this moment. Yes, I've moved it.