From patchwork Tue Jun 16 20:03:04 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frodo Lai X-Patchwork-Id: 6619851 Return-Path: X-Original-To: patchwork-linux-input@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 4C5029F1C1 for ; Tue, 16 Jun 2015 20:03:36 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 640C6206A4 for ; Tue, 16 Jun 2015 20:03:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 63AC2204E3 for ; Tue, 16 Jun 2015 20:03:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755144AbbFPUDd (ORCPT ); Tue, 16 Jun 2015 16:03:33 -0400 Received: from mail-pd0-f179.google.com ([209.85.192.179]:36437 "EHLO mail-pd0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753016AbbFPUDc (ORCPT ); Tue, 16 Jun 2015 16:03:32 -0400 Received: by pdjm12 with SMTP id m12so21311991pdj.3; Tue, 16 Jun 2015 13:03:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=3tgmjV+W3A3OrfHWhP7oSLw/HhgUanaQd0LvD7MD35I=; b=MV0PUWp8PkH+BwBPIHTYmXU+HEsa0aaqjcs/YOuG+tSGr4IyLYGWpo30uK8WNG/2Vp 8+0gPa/Kdy9xis/pWa3cebeVLsaXs/qN5s8uNSexqpyiVXT5q3M8GwyorGImG1FW6Hf/ Nr3/nvxuSsC8v41pVyEn05dDTPSZXN9jZ0zJizy/6d/uV2tFtBfGxkLAw47BdnE+o+8+ iuMW7ar2R3YYS7egcZeLoicnjWcWAlkebxIbV+5XSA1RJugo2vU5fDRXvPwF2pDUQQ+H LpilmSqkIzK3s9xDOKjiB1W21uNBDCFzf9x5VGDo+z+fQxk3xkFEFajZXdt3FOVIupyl wfkg== X-Received: by 10.67.7.199 with SMTP id de7mr3496029pad.107.1434485012098; Tue, 16 Jun 2015 13:03:32 -0700 (PDT) Received: from localhost.localdomain (wsip-98-189-226-50.oc.oc.cox.net. [98.189.226.50]) by mx.google.com with ESMTPSA id j9sm2213937pbq.92.2015.06.16.13.03.29 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 16 Jun 2015 13:03:30 -0700 (PDT) From: Frodo Lai X-Google-Original-From: Frodo Lai To: dmitry.torokhov@gmail.com Cc: rogerq@ti.com, rydberg@bitmath.org, jg1.han@samsung.com, linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] Input: pixcir_i2c_ts - fix receive error Date: Tue, 16 Jun 2015 13:03:04 -0700 Message-Id: <1434484984-15418-1-git-send-email-frodo_lai@bcmcom.com> X-Mailer: git-send-email 1.7.9.5 Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The i2c_master_recv() uses readsize to receive data from i2c but compares to size of rdbuf which is always 27. This would casue problem when the max_fingers is not 5. Change the comparison value to readsize instead. Signed-off-by: Frodo Lai --- drivers/input/touchscreen/pixcir_i2c_ts.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/input/touchscreen/pixcir_i2c_ts.c b/drivers/input/touchscreen/pixcir_i2c_ts.c index 2c21071..8f3e243 100644 --- a/drivers/input/touchscreen/pixcir_i2c_ts.c +++ b/drivers/input/touchscreen/pixcir_i2c_ts.c @@ -78,7 +78,7 @@ static void pixcir_ts_parse(struct pixcir_i2c_ts_data *tsdata, } ret = i2c_master_recv(tsdata->client, rdbuf, readsize); - if (ret != sizeof(rdbuf)) { + if (ret != readsize) { dev_err(&tsdata->client->dev, "%s: i2c_master_recv failed(), ret=%d\n", __func__, ret);