summaryrefslogtreecommitdiffstats
path: root/crypto/seed.c
diff options
context:
space:
mode:
authorJason Gunthorpe <jgg@nvidia.com>2023-06-05 21:59:42 -0300
committerJoerg Roedel <jroedel@suse.de>2023-07-14 16:14:13 +0200
commitdf15d76dcacac2126a4d20ba06c9d7e4b18bad8e (patch)
tree644355364353ad12cfac3426ff70824c66be54e3 /crypto/seed.c
parent7bdb99622f7e7dcaa58bfc2fa98caf23cfc40994 (diff)
downloadlinux-stable-df15d76dcacac2126a4d20ba06c9d7e4b18bad8e.tar.gz
linux-stable-df15d76dcacac2126a4d20ba06c9d7e4b18bad8e.tar.bz2
linux-stable-df15d76dcacac2126a4d20ba06c9d7e4b18bad8e.zip
iommu: Simplify the __iommu_group_remove_device() flow
Instead of returning the struct group_device and then later freeing it, do the entire free under the group->mutex and defer only putting the iommu_group. It is safe to remove the sysfs_links and free memory while holding that mutex. Move the sanity assert of the group status into __iommu_group_free_device(). The next patch will improve upon this and consolidate the group put and the mutex into __iommu_group_remove_device(). __iommu_group_free_device() is close to being the paired undo of iommu_group_add_device(), following patches will improve on that. Reviewed-by: Kevin Tian <kevin.tian@intel.com> Reviewed-by: Lu Baolu <baolu.lu@linux.intel.com> Signed-off-by: Jason Gunthorpe <jgg@nvidia.com> Link: https://lore.kernel.org/r/4-v3-328044aa278c+45e49-iommu_probe_jgg@nvidia.com Signed-off-by: Joerg Roedel <jroedel@suse.de>
Diffstat (limited to 'crypto/seed.c')
0 files changed, 0 insertions, 0 deletions