From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753220AbcGTBRD (ORCPT ); Tue, 19 Jul 2016 21:17:03 -0400 Received: from mail-qt0-f194.google.com ([209.85.216.194]:34162 "EHLO mail-qt0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752537AbcGTBRA (ORCPT ); Tue, 19 Jul 2016 21:17:00 -0400 MIME-Version: 1.0 In-Reply-To: <1468971821-16982-1-git-send-email-aduggan@synaptics.com> References: <1468971821-16982-1-git-send-email-aduggan@synaptics.com> From: Nitin Chaudhary Date: Tue, 19 Jul 2016 18:16:58 -0700 Message-ID: Subject: Re: [PATCH] Input: synaptics-rmi4: Fix maximum size check for F12 control register 8 To: Andrew Duggan Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, Dmitry Torokhov , Jiri Kosina , Benjamin Tissoires , Vincent Huang , Nick Dyer , Chris Healy , stable@vger.kernel.org Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Tested on i.MX6Q Board with Synaptics 7813 Touch Controller, works fine. Tested by: Nitin Chaudhary On Tue, Jul 19, 2016 at 4:43 PM, Andrew Duggan wrote: > According to the RMI4 spec the maximum size of F12 control register 8 is > 15 bytes. The current code incorrectly reports an error if control 8 is > greater then 14. Making sensors with a control register 8 with 15 bytes > unusable. > > Signed-off-by: Andrew Duggan > Reported-by: Chris Healy > Cc: stable@vger.kernel.org > --- > drivers/input/rmi4/rmi_f12.c | 7 ++++--- > 1 file changed, 4 insertions(+), 3 deletions(-) > > diff --git a/drivers/input/rmi4/rmi_f12.c b/drivers/input/rmi4/rmi_f12.c > index c30fd86..9b0d9f7 100644 > --- a/drivers/input/rmi4/rmi_f12.c > +++ b/drivers/input/rmi4/rmi_f12.c > @@ -68,7 +68,7 @@ static int rmi_f12_read_sensor_tuning(struct f12_data *f12) > struct rmi_device *rmi_dev = fn->rmi_dev; > int ret; > int offset; > - u8 buf[14]; > + u8 buf[15]; > int pitch_x = 0; > int pitch_y = 0; > int clip_x_low = 0; > @@ -88,8 +88,9 @@ static int rmi_f12_read_sensor_tuning(struct f12_data *f12) > > offset = rmi_register_desc_calc_reg_offset(&f12->control_reg_desc, 8); > > - if (item->reg_size > 14) { > - dev_err(&fn->dev, "F12 control8 should be 14 bytes, not: %ld\n", > + if (item->reg_size > 15) { > + dev_err(&fn->dev, > + "F12 control8 should be a maximum of 15 bytes, not: %ld\n", > item->reg_size); > return -ENODEV; > } > -- > 2.7.4 > On Tue, Jul 19, 2016 at 4:43 PM, Andrew Duggan wrote: > According to the RMI4 spec the maximum size of F12 control register 8 is > 15 bytes. The current code incorrectly reports an error if control 8 is > greater then 14. Making sensors with a control register 8 with 15 bytes > unusable. > > Signed-off-by: Andrew Duggan > Reported-by: Chris Healy > Cc: stable@vger.kernel.org > --- > drivers/input/rmi4/rmi_f12.c | 7 ++++--- > 1 file changed, 4 insertions(+), 3 deletions(-) > > diff --git a/drivers/input/rmi4/rmi_f12.c b/drivers/input/rmi4/rmi_f12.c > index c30fd86..9b0d9f7 100644 > --- a/drivers/input/rmi4/rmi_f12.c > +++ b/drivers/input/rmi4/rmi_f12.c > @@ -68,7 +68,7 @@ static int rmi_f12_read_sensor_tuning(struct f12_data *f12) > struct rmi_device *rmi_dev = fn->rmi_dev; > int ret; > int offset; > - u8 buf[14]; > + u8 buf[15]; > int pitch_x = 0; > int pitch_y = 0; > int clip_x_low = 0; > @@ -88,8 +88,9 @@ static int rmi_f12_read_sensor_tuning(struct f12_data *f12) > > offset = rmi_register_desc_calc_reg_offset(&f12->control_reg_desc, 8); > > - if (item->reg_size > 14) { > - dev_err(&fn->dev, "F12 control8 should be 14 bytes, not: %ld\n", > + if (item->reg_size > 15) { > + dev_err(&fn->dev, > + "F12 control8 should be a maximum of 15 bytes, not: %ld\n", > item->reg_size); > return -ENODEV; > } > -- > 2.7.4 > -- Thanks & Regards Nitin Chaudhary Nitin Chaudhary MS, Electrical Engineering University of Southern California Intern, Zodiac In-flight Innovations