mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-07 19:30:30 +09:00
iommu: Use right function to get group for device
[ Upstream commit57274ea257] The iommu_group_get_for_dev() will allocate a group for a device if it isn't in any group. This isn't the use case in iommu_request_dm_for_dev(). Let's use iommu_group_get() instead. Fixes:d290f1e70d("iommu: Introduce iommu_request_dm_for_dev()") Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com> Signed-off-by: Joerg Roedel <jroedel@suse.de> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
ccd9708c9c
commit
497372c616
@@ -1582,9 +1582,9 @@ int iommu_request_dm_for_dev(struct device *dev)
|
||||
int ret;
|
||||
|
||||
/* Device must already be in a group before calling this function */
|
||||
group = iommu_group_get_for_dev(dev);
|
||||
if (IS_ERR(group))
|
||||
return PTR_ERR(group);
|
||||
group = iommu_group_get(dev);
|
||||
if (!group)
|
||||
return -EINVAL;
|
||||
|
||||
mutex_lock(&group->mutex);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user