Skip to content

Commit

Permalink
iommu: Fix return code in iommu_group_alloc_default_domain()
Browse files Browse the repository at this point in the history
This function returns NULL on errors, not ERR_PTR.

Fixes: 1c68cbc ("iommu: Add IOMMU_DOMAIN_PLATFORM")
Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
Link: https://lore.kernel.org/r/8fb75157-6c81-4a9c-9992-d73d49902fa8@moroto.mountain
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Link: https://lore.kernel.org/r/0-v2-ee2bae9af0f2+96-iommu_ga_err_ptr_jgg@nvidia.com
Signed-off-by: Joerg Roedel <jroedel@suse.de>
  • Loading branch information
jgunthorpe authored and joergroedel committed Oct 5, 2023
1 parent 0f6a904 commit b85b4f3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/iommu/iommu.c
Original file line number Diff line number Diff line change
Expand Up @@ -1787,7 +1787,7 @@ iommu_group_alloc_default_domain(struct iommu_group *group, int req_type)
*/
if (ops->default_domain) {
if (req_type)
return ERR_PTR(-EINVAL);
return NULL;
return ops->default_domain;
}

Expand Down

0 comments on commit b85b4f3

Please sign in to comment.