From patchwork Mon Dec 24 18:37:19 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aditya Pakki X-Patchwork-Id: 10742393 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E55006C5 for ; Mon, 24 Dec 2018 18:43:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C6F6028AD5 for ; Mon, 24 Dec 2018 18:43:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B581128B62; Mon, 24 Dec 2018 18:43:51 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 456CE28AD5 for ; Mon, 24 Dec 2018 18:43:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725792AbeLXSnu (ORCPT ); Mon, 24 Dec 2018 13:43:50 -0500 Received: from mta-p7.oit.umn.edu ([134.84.196.207]:33714 "EHLO mta-p7.oit.umn.edu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725747AbeLXSnu (ORCPT ); Mon, 24 Dec 2018 13:43:50 -0500 X-Greylist: delayed 379 seconds by postgrey-1.27 at vger.kernel.org; Mon, 24 Dec 2018 13:43:49 EST Received: from localhost (unknown [127.0.0.1]) by mta-p7.oit.umn.edu (Postfix) with ESMTP id 4BA93BE6 for ; Mon, 24 Dec 2018 18:37:30 +0000 (UTC) X-Virus-Scanned: amavisd-new at umn.edu Received: from mta-p7.oit.umn.edu ([127.0.0.1]) by localhost (mta-p7.oit.umn.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id mq1CCynFGYZ2 for ; Mon, 24 Dec 2018 12:37:30 -0600 (CST) Received: from mail-it1-f197.google.com (mail-it1-f197.google.com [209.85.166.197]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mta-p7.oit.umn.edu (Postfix) with ESMTPS id 1D9815A8 for ; Mon, 24 Dec 2018 12:37:30 -0600 (CST) Received: by mail-it1-f197.google.com with SMTP id i12so14103897ita.3 for ; Mon, 24 Dec 2018 10:37:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=umn.edu; s=google; h=from:to:cc:subject:date:message-id; bh=YmLhqWFikrVyBjK/2tGEhyVwtDTbnJjZ767d5VTB8Pc=; b=EI2K0HDJWKeu29kHc1fKlsQUnwbiO9nx3LQqQRTrsuw4lFFPc0RXPGGF5damwxuHE+ vxxo8aNXVCatGeWFg7aEv8Cg+WR//lP+4JqUt7O4T929O9CRY7xUzRz0bpXdDwHpPwle XHO8FlMY4+jZfPtlaFQQWyFKdDOdFwDZfsf0kF4je23Lyo4l+SA0pej/5fkuVncrgdKy XfAe0qgSNS0yLOYufaQ8fiD2dpq2IOtvoYVU1fHXHaUsNSFm0JkmCu0u5YXdhwaoatSk LU+oMRb0CSESAObHuZXLVpLtWBCTul8yMOiMvtHfjA9yiEsWbNRZpKieGdCVM0zUqAvk sQXg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=YmLhqWFikrVyBjK/2tGEhyVwtDTbnJjZ767d5VTB8Pc=; b=J5pZn/xuu0jI6C5eYdvSjdSdzVwAtiyHypp8i50vsL9xgjFXhCA2vDfBSCuiHL+zAy /G+pZM13s5ovy4YgAIBnqe5WornUVmDX9UgsG+ISD1nQx+gLe0l51SjAtkeiezrvA76t +5Dh2PWTepVvtMP22FkiHPuqMBbrfB0lorEf0ZsPtuvKJqmAPpNDJW5Xl6ofVxLqX/l6 XDoeGN6IsKm/wtGeulwLO4MmqXQsI1q+s3uamX1tLndx1zxf1Cq2QY9Qw20CF2yFqprg NkkIT55Q+o3XzTI0iHyFNWtVZb46QP46Y+XJEhv6FigFQD0FALOU4B3ovL6KzjRBeS+N Y01w== X-Gm-Message-State: AJcUukfkaDqeGQS1IeWiTPO3BFlRn8vlF+6ji9DQA4C65mUaGQC1seKl vV33U3OQxcDydyYYaOXNB+5sHE+tPGHC3lM5hPf2Vw0IpbeQPtPI7E8Rm0g8amX85bvk61ASrFE BkAjj2KbFFcHD56qoId6mGUADFik= X-Received: by 2002:a24:5e05:: with SMTP id h5mr9705635itb.103.1545676649716; Mon, 24 Dec 2018 10:37:29 -0800 (PST) X-Google-Smtp-Source: AFSGD/VQY7uweWKGvBEjcgBGvh90ugTFrvC/kTCQ4pwwj18IL+vnFi6n4g5cqccjnhaKHY2Txb++ww== X-Received: by 2002:a24:5e05:: with SMTP id h5mr9705623itb.103.1545676649470; Mon, 24 Dec 2018 10:37:29 -0800 (PST) Received: from cs-u-syssec1.cs.umn.edu (cs-u-syssec1.cs.umn.edu. [134.84.121.78]) by smtp.gmail.com with ESMTPSA id k2sm10689886itk.35.2018.12.24.10.37.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 24 Dec 2018 10:37:28 -0800 (PST) From: Aditya Pakki To: pakki001@umn.edu Cc: kjlu@umn.edu, Michael Hennerich , Dmitry Torokhov , linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] input/touchscreen: Fix a missing check on regmap_bulk_read Date: Mon, 24 Dec 2018 12:37:19 -0600 Message-Id: <20181224183719.22211-1-pakki001@umn.edu> X-Mailer: git-send-email 2.17.1 Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP regmap_bulk_read() can return a non zero value on failure. The fix checks if the function call succeeded before calling mod_timer. Signed-off-by: Aditya Pakki --- drivers/input/touchscreen/ad7879.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/input/touchscreen/ad7879.c b/drivers/input/touchscreen/ad7879.c index 6bad23ee47a1..735cb4c0d913 100644 --- a/drivers/input/touchscreen/ad7879.c +++ b/drivers/input/touchscreen/ad7879.c @@ -247,11 +247,12 @@ static void ad7879_timer(struct timer_list *t) static irqreturn_t ad7879_irq(int irq, void *handle) { struct ad7879 *ts = handle; + int ret; - regmap_bulk_read(ts->regmap, AD7879_REG_XPLUS, - ts->conversion_data, AD7879_NR_SENSE); + ret = regmap_bulk_read(ts->regmap, AD7879_REG_XPLUS, + ts->conversion_data, AD7879_NR_SENSE); - if (!ad7879_report(ts)) + if (!ret && !ad7879_report(ts)) mod_timer(&ts->timer, jiffies + TS_PEN_UP_TIMEOUT); return IRQ_HANDLED;