Re: [PATCH 08/18] vfio/mdev: Reorganize mdev_device_create()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 23 Mar 2021 14:55:25 -0300
Jason Gunthorpe <jgg@xxxxxxxxxx> wrote:

> Once the memory for the struct mdev_device is allocated it should
> immediately be device_initialize()'d and filled in so that put_device()
> can always be used to undo the allocation.
> 
> Place the mdev_get/put_parent() so that they are clearly protecting the
> mdev->parent pointer. Move the final put to the release function so that
> the lifetime rules are trivial to understand.
> 
> Remove mdev_device_free() as the release function via device_put() is now
> usable in all cases.
> 
> Signed-off-by: Jason Gunthorpe <jgg@xxxxxxxxxx>
> ---
>  drivers/vfio/mdev/mdev_core.c | 46 +++++++++++++++--------------------
>  1 file changed, 20 insertions(+), 26 deletions(-)

Reviewed-by: Cornelia Huck <cohuck@xxxxxxxxxx>




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux