提交 818010da 编写于 作者: O oder_chiou@realtek.com 提交者: Mark Brown

ASoC: rt5514: Add the sanity checks of the buffer related address

The patch add the sanity checks of the buffer related address to make sure
the addresses are valid.
Signed-off-by: NOder Chiou <oder_chiou@realtek.com>
Signed-off-by: NMark Brown <broonie@kernel.org>
上级 c2bf2525
...@@ -173,9 +173,14 @@ static irqreturn_t rt5514_spi_irq(int irq, void *data) ...@@ -173,9 +173,14 @@ static irqreturn_t rt5514_spi_irq(int irq, void *data)
rt5514_dsp->buf_rp = buf[0] | buf[1] << 8 | buf[2] << 16 | rt5514_dsp->buf_rp = buf[0] | buf[1] << 8 | buf[2] << 16 |
buf[3] << 24; buf[3] << 24;
if (rt5514_dsp->buf_rp % 8)
rt5514_dsp->buf_rp = (rt5514_dsp->buf_rp / 8) * 8;
rt5514_dsp->buf_size = rt5514_dsp->buf_limit - rt5514_dsp->buf_base; rt5514_dsp->buf_size = rt5514_dsp->buf_limit - rt5514_dsp->buf_base;
schedule_delayed_work(&rt5514_dsp->copy_work, 0); if (rt5514_dsp->buf_base && rt5514_dsp->buf_limit &&
rt5514_dsp->buf_rp && rt5514_dsp->buf_size)
schedule_delayed_work(&rt5514_dsp->copy_work, 0);
return IRQ_HANDLED; return IRQ_HANDLED;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册