diff options
author | Mostafa Saleh <[email protected]> | 2024-06-04 18:52:18 +0000 |
---|---|---|
committer | Will Deacon <[email protected]> | 2024-06-05 13:48:00 +0100 |
commit | d3867e7148318e12b5d69b64950622f5ed06fe86 (patch) | |
tree | 37e32999d31526da73119f77ee63143855d86304 | |
parent | c3f38fa61af77b49866b006939479069cd451173 (diff) |
iommu/arm-smmu-v3: Avoid uninitialized asid in case of error
Static checker is complaining about the ASID possibly set uninitialized.
This only happens in case of error and this value would be ignored anyway.
A simple fix would be just to initialize the local variable to zero,
this path will only be reached on the first attach to a domain where
the CD is already initialized to zero.
This avoids having to bloat the function with an error path.
Closes: https://lore.kernel.org/linux-iommu/[email protected]/T/#u
Reported-by: Dan Carpenter <[email protected]>
Signed-off-by: Mostafa Saleh <[email protected]>
Fixes: 04905c17f648 ("iommu/arm-smmu-v3: Build the whole CD in arm_smmu_make_s1_cd()")
Reviewed-by: Jason Gunthorpe <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Will Deacon <[email protected]>
-rw-r--r-- | drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c index ab415e107054..f456bcf1890b 100644 --- a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c +++ b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c @@ -2302,7 +2302,7 @@ static int arm_smmu_domain_finalise_s1(struct arm_smmu_device *smmu, struct arm_smmu_domain *smmu_domain) { int ret; - u32 asid; + u32 asid = 0; struct arm_smmu_ctx_desc *cd = &smmu_domain->cd; refcount_set(&cd->refs, 1); |