diff options
author | Will Deacon <will.deacon@arm.com> | 2015-12-04 15:00:29 +0300 |
---|---|---|
committer | Will Deacon <will.deacon@arm.com> | 2015-12-17 15:05:33 +0300 |
commit | a0d5c04c6053d8c47cca37384ae472f6b2ee0dee (patch) | |
tree | e5ed0c581db4fda58fc3129c8869e01919e985f7 /drivers/iommu/arm-smmu-v3.c | |
parent | 9a4a9d8c34bc0b0102e8a9dd67ee3910b0bfaeb4 (diff) | |
download | linux-a0d5c04c6053d8c47cca37384ae472f6b2ee0dee.tar.xz |
iommu/arm-smmu: Handle unknown CERROR values gracefully
Whilst the architecture only defines a few of the possible CERROR values,
we should handle unknown values gracefully rather than go out of bounds
trying to print out an error description.
Signed-off-by: Will Deacon <will.deacon@arm.com>
Diffstat (limited to 'drivers/iommu/arm-smmu-v3.c')
-rw-r--r-- | drivers/iommu/arm-smmu-v3.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/iommu/arm-smmu-v3.c b/drivers/iommu/arm-smmu-v3.c index 3ea4d576bf08..4c5ef4e5da98 100644 --- a/drivers/iommu/arm-smmu-v3.c +++ b/drivers/iommu/arm-smmu-v3.c @@ -857,15 +857,17 @@ static void arm_smmu_cmdq_skip_err(struct arm_smmu_device *smmu) }; dev_err(smmu->dev, "CMDQ error (cons 0x%08x): %s\n", cons, - cerror_str[idx]); + idx < ARRAY_SIZE(cerror_str) ? cerror_str[idx] : "Unknown"); switch (idx) { - case CMDQ_ERR_CERROR_ILL_IDX: - break; case CMDQ_ERR_CERROR_ABT_IDX: dev_err(smmu->dev, "retrying command fetch\n"); case CMDQ_ERR_CERROR_NONE_IDX: return; + case CMDQ_ERR_CERROR_ILL_IDX: + /* Fallthrough */ + default: + break; } /* |