Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Register
  • Sign in
  • L linux
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • Deployments
    • Deployments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • Kirill Smelkov
  • linux
  • Repository
  • linux
  • drivers
  • vfio
  • mdev
  • mdev_core.c
Find file BlameHistoryPermalink
  • Jason Gunthorpe's avatar
    vfio/mdev: Reorganize mdev_device_create() · fbd0e2b0
    Jason Gunthorpe authored Apr 06, 2021
    
    
    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. Update the goto labels to
    follow the normal convention.
    
    Remove mdev_device_free() as the release function via device_put() is now
    usable in all cases.
    
    Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
    Reviewed-by: default avatarKevin Tian <kevin.tian@intel.com>
    Reviewed-by: default avatarCornelia Huck <cohuck@redhat.com>
    Signed-off-by: default avatarJason Gunthorpe <jgg@nvidia.com>
    Message-Id: <8-v2-d36939638fc6+d54-vfio2_jgg@nvidia.com>
    Signed-off-by: default avatarAlex Williamson <alex.williamson@redhat.com>
    fbd0e2b0
GitLab Nexedi Edition | About GitLab | About Nexedi | 沪ICP备2021021310号-2 | 沪ICP备2021021310号-7