iommu/amd: Propagate the error code returned by __modify_irte_ga() in modify_irte_ga()
Subsystems (3)
PATCH 1/1 iommu/amd: Propagate the error code returned by __modify_irte_ga() in modify_irte_ga()
The return type of __modify_irte_ga() is int, but modify_irte_ga() treats it as a bool. Casting the int to bool discards the error code.
To fix the issue, change the type of ret to int in modify_irte_ga().
--- drivers/iommu/amd/iommu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iommu/amd/iommu.c +1 -1
@@ -3354,7 +3354,7 @@ static int __modify_irte_ga(struct amd_iommu *iommu, u16 devid, int index,static int modify_irte_ga (struct amd_iommu *iommu,u16 devid,int index,struct irte_ga *irte) { -bool ret; +int ret; ret =__modify_irte_ga (iommu, devid, index, irte);if (ret)
Signature · 1 line
2.20.1
Quoted 9 lines · Jinhui Guo
The return type of
__modify_irte_ga()is int, butmodify_irte_ga()treats it as a bool. Casting the int to bool discards the error code.To fix the issue, change the type of ret to int in
modify_irte_ga().Fixes 57cdb720eaa5 ("iommu/amd: Do not flush IRTE when only updating isRun and destination fields")Signed-off-by Jinhui Guo <[email protected]>---
Hi,
Thanks for the patch. The subject line exceeds the recommended length. can you please resend patch with concise subject line.
Quoted 18 lines
drivers/iommu/amd/iommu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/iommu/amd/iommu.c +1
-1@@ -3354,7 +3354,7 @@ static int __modify_irte_ga(struct amd_iommu *iommu, u16 devid, int index,static int modify_irte_ga (struct amd_iommu *iommu,u16 devid,int index,struct irte_ga *irte) { -bool ret; +int ret; ret =__modify_irte_ga (iommu, devid, index, irte);if (ret)Signature · 1 line
2.20.1
Quoted 8 lines · Jinhui Guo
The return type of
__modify_irte_ga()is int, butmodify_irte_ga()treats it as a bool. Casting the int to bool discards the error code.To fix the issue, change the type of ret to int in
modify_irte_ga().Fixes 57cdb720eaa5 ("iommu/amd: Do not flush IRTE when only updating isRun and destination fields")Signed-off-by Jinhui Guo <[email protected]>
-Vasant
Quoted 11 lines · Jinhui Guo
The return type of
__modify_irte_ga()is int, butmodify_irte_ga()treats it as a bool. Casting the int to bool discards the error code.To fix the issue, change the type of ret to int in
modify_irte_ga().Fixes 57cdb720eaa5 ("iommu/amd: Do not flush IRTE when only updating isRun and destination fields")Signed-off-by Jinhui Guo <[email protected]>--- drivers/iommu/amd/iommu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Applied, thanks.