ASoC: SDCA: Fix off by one error in IRQ bound check

Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
Closes: https://lore.kernel.org/r/202507150415.M1tCgi3p-lkp@intel.com/
Fixes: b126394d9e ("ASoC: SDCA: Generic interrupt support")
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://patch.msgid.link/20250715151723.2964336-2-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
Charles Keepax
2025-07-15 16:17:21 +01:00
committed by Mark Brown
parent bfd291279f
commit 3f2e4c1192

View File

@@ -262,7 +262,7 @@ int sdca_irq_request(struct device *dev, struct sdca_interrupt_info *info,
{
int ret;
if (sdca_irq < 0 || sdca_irq > SDCA_MAX_INTERRUPTS) {
if (sdca_irq < 0 || sdca_irq >= SDCA_MAX_INTERRUPTS) {
dev_err(dev, "bad irq request: %d\n", sdca_irq);
return -EINVAL;
}