iommu: Fix return code in iommu_group_alloc_default_domain()
PATCH 1/1 iommu: Fix return code in iommu_group_alloc_default_domain()
This function returns NULL on errors, not ERR_PTR.
--- drivers/iommu/iommu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iommu/iommu.c +1 -1
@@ -1787,7 +1787,7 @@ iommu_group_alloc_default_domain(struct iommu_group *group, int req_type)*/ if (ops->default_domain) {if (req_type) -return -EINVAL ; +return NULL ;return ops->default_domain; }
base-commit: 2fa5936cb764a36a95f5b31c71fc6a2954336221
Signature · 1 line
2.42.0
Quoted 15 lines · Jason Gunthorpe
This function returns NULL on errors, not
ERR_PTR.Fixes 1c68cbc64fe6 ("iommu: Add IOMMU_DOMAIN_PLATFORM")Reported-by Dan Carpenter <[email protected]>Signed-off-by Jason Gunthorpe <[email protected]>--- drivers/iommu/iommu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/iommu/iommu.c +0
-0
drivers/iommu/iommu.c iommu_group_alloc_default_domain(struct iommu_group *group, int req_type) · line 1790
Quoted 5 lines
drivers/iommu/iommu.c +1
-1@@ -1787,7 +1787,7 @@ iommu_group_alloc_default_domain(struct iommu_group *group, int req_type)*/ if (ops->default_domain) {if (req_type) -return -EINVAL ; +return NULL ;
This looks like a merge conflict? -EINVAL is an int and NULL is a pointer. #strange
regards,
dan carpenter
Quoted 11 lines · Dan Carpenter
Quoted 10 lines · Jason Gunthorpe
This function returns NULL on errors, not
ERR_PTR.Fixes 1c68cbc64fe6 ("iommu: Add IOMMU_DOMAIN_PLATFORM")Reported-by Dan Carpenter <[email protected]>Signed-off-by Jason Gunthorpe <[email protected]>--- drivers/iommu/iommu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 13 lines
drivers/iommu/iommu.c iommu_group_alloc_default_domain(struct iommu_group *group, int req_type) · line 1790
Quoted 10 lines
drivers/iommu/iommu.c +1
-1@@ -1787,7 +1787,7 @@ iommu_group_alloc_default_domain(struct iommu_group *group, int req_type)*/ if (ops->default_domain) {if (req_type) -return -EINVAL ; +return NULL ;This looks like a merge conflict?
-EINVALis an int and NULL is a pointer. #strange
Uhh.. the power patch I was working on accidently collected half of this change and I didn't notice :\
Thanks,
Jason