From patchwork Wed Aug 27 21:32:00 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jiri Kosina X-Patchwork-Id: 4791131 X-Patchwork-Delegate: jikos@jikos.cz Return-Path: X-Original-To: patchwork-linux-input@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 3D06DC0338 for ; Wed, 27 Aug 2014 21:32:29 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 661392012E for ; Wed, 27 Aug 2014 21:32:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 893F62012D for ; Wed, 27 Aug 2014 21:32:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935981AbaH0VcF (ORCPT ); Wed, 27 Aug 2014 17:32:05 -0400 Received: from cantor2.suse.de ([195.135.220.15]:43811 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935931AbaH0VcC (ORCPT ); Wed, 27 Aug 2014 17:32:02 -0400 Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 7C7A8AB46; Wed, 27 Aug 2014 21:32:00 +0000 (UTC) Date: Wed, 27 Aug 2014 23:32:00 +0200 (CEST) From: Jiri Kosina To: =?ISO-8859-15?Q?Bruno_Pr=E9mont?= cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/2] HID: picolcd: sanity check report size in raw_event() callback In-Reply-To: Message-ID: References: <20140827101311.098f3fd1@pluto> User-Agent: Alpine 2.00 (LNX 1167 2008-08-23) MIME-Version: 1.0 Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable 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 On Wed, 27 Aug 2014, Jiri Kosina wrote: > > Is it worth adding report->id to this hid_warn()? > > > > A valid device is not expected to ever send >64 bytes reports but in > > case a firmware update would do so it would help to know for which > > report it was. > > It definitely wouldn't hurt. Pull request with the original patch is now > on its way to Linus though, so let's do this as a followup patch on top > once this is merged. I've just queued the below for 3.18. From: Jiri Kosina Subject: [PATCH] HID: picolcd: be more verbose when reporting report size error picolcd device is not expected to send any report with size larger than 64 bytes. If this impossible event happens (sic!), print also a report ID to allow for easier debugging. Suggested-by: Bruno Prémont Signed-off-by: Jiri Kosina --- drivers/hid/hid-picolcd_core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/hid/hid-picolcd_core.c b/drivers/hid/hid-picolcd_core.c index 020df3c..c1b29a9 100644 --- a/drivers/hid/hid-picolcd_core.c +++ b/drivers/hid/hid-picolcd_core.c @@ -351,8 +351,8 @@ static int picolcd_raw_event(struct hid_device *hdev, return 1; if (size > 64) { - hid_warn(hdev, "invalid size value (%d) for picolcd raw event\n", - size); + hid_warn(hdev, "invalid size value (%d) for picolcd raw event (%d)\n", + size, report->id); return 0; }