提交 e85bb0be 编写于 作者: A Aditya Pakki 提交者: Dmitry Torokhov

Input: ad7879 - add check for read errors in interrupt

regmap_bulk_read() can return a non zero value on failure. The fix checks
if the function call succeeded before calling mod_timer. The issue was
identified by a static analysis tool.
Signed-off-by: NAditya Pakki <pakki001@umn.edu>
Signed-off-by: NDmitry Torokhov <dmitry.torokhov@gmail.com>
上级 1cdbd3e5
......@@ -246,11 +246,14 @@ static void ad7879_timer(struct timer_list *t)
static irqreturn_t ad7879_irq(int irq, void *handle)
{
struct ad7879 *ts = handle;
int error;
regmap_bulk_read(ts->regmap, AD7879_REG_XPLUS,
ts->conversion_data, AD7879_NR_SENSE);
if (!ad7879_report(ts))
error = regmap_bulk_read(ts->regmap, AD7879_REG_XPLUS,
ts->conversion_data, AD7879_NR_SENSE);
if (error)
dev_err_ratelimited(ts->dev, "failed to read %#02x: %d\n",
AD7879_REG_XPLUS, error);
else if (!ad7879_report(ts))
mod_timer(&ts->timer, jiffies + TS_PEN_UP_TIMEOUT);
return IRQ_HANDLED;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册