diff options
author | Ricardo Rivera-Matos <rriveram@opensource.cirrus.com> | 2023-08-31 11:20:39 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2024-08-29 17:33:22 +0200 |
commit | 5a002f41ebffc73460a0617c011e956ed8a4ca99 (patch) | |
tree | 5ac9c360ed2716f948b2778adb188448f3aaf815 | |
parent | 8574cdabb526ac3972316c5c95028c0dacb161c5 (diff) |
ASoC: cs35l45: Checks index of cs35l45_irqs[]
[ Upstream commit 44f37b6ce041c838cb2f49f08998c41f1ab3b08c ]
Checks the index computed by the virq offset before printing the
error condition in cs35l45_spk_safe_err() handler.
Signed-off-by: Ricardo Rivera-Matos <rriveram@opensource.cirrus.com>
Signed-off-by: Vlad Karpovich <vkarpovi@opensource.cirrus.com>
Acked-by: Ricardo Rivera-Matos <rriveram@opensource.cirrus.com>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20230831162042.471801-1-vkarpovi@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r-- | sound/soc/codecs/cs35l45.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sound/soc/codecs/cs35l45.c b/sound/soc/codecs/cs35l45.c index 9b9fc2d491089..7e439c778c6b4 100644 --- a/sound/soc/codecs/cs35l45.c +++ b/sound/soc/codecs/cs35l45.c @@ -1067,7 +1067,10 @@ static irqreturn_t cs35l45_spk_safe_err(int irq, void *data) i = irq - regmap_irq_get_virq(cs35l45->irq_data, 0); - dev_err(cs35l45->dev, "%s condition detected!\n", cs35l45_irqs[i].name); + if (i < 0 || i >= ARRAY_SIZE(cs35l45_irqs)) + dev_err(cs35l45->dev, "Unspecified global error condition (%d) detected!\n", irq); + else + dev_err(cs35l45->dev, "%s condition detected!\n", cs35l45_irqs[i].name); return IRQ_HANDLED; } |