From patchwork Mon Jan 14 15:06:20 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans Petter Selasky X-Patchwork-Id: 16252 Received: from mail.tu-berlin.de ([130.149.7.33]) by www.linuxtv.org with esmtp (Exim 4.72) (envelope-from ) id 1Tulax-0007cD-5A; Mon, 14 Jan 2013 16:05:03 +0100 X-tubIT-Incoming-IP: 209.132.180.67 Received: from vger.kernel.org ([209.132.180.67]) by mail.tu-berlin.de (exim-4.75/mailfrontend-3) with esmtp id 1Tulaw-0006Jy-E5; Mon, 14 Jan 2013 16:05:02 +0100 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756345Ab3ANPE5 (ORCPT + 1 other); Mon, 14 Jan 2013 10:04:57 -0500 Received: from mailfe05.c2i.net ([212.247.154.130]:33581 "EHLO swip.net" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1756300Ab3ANPE5 convert rfc822-to-8bit (ORCPT ); Mon, 14 Jan 2013 10:04:57 -0500 X-T2-Spam-Status: No, hits=-1.0 required=5.0 tests=ALL_TRUSTED Received: from [176.74.213.204] (account mc467741@c2i.net HELO laptop015.hselasky.homeunix.org) by mailfe05.swip.net (CommuniGate Pro SMTP 5.4.4) with ESMTPA id 363335668 for linux-media@vger.kernel.org; Mon, 14 Jan 2013 16:04:54 +0100 From: Hans Petter Selasky To: linux-media@vger.kernel.org Subject: Re: [PATCH] Correctly set data for USB request in case of a previous failure. Date: Mon, 14 Jan 2013 16:06:20 +0100 User-Agent: KMail/1.13.7 (FreeBSD/9.1-STABLE; KDE/4.8.4; amd64; ; ) References: <201301141355.52394.hselasky@c2i.net> In-Reply-To: <201301141355.52394.hselasky@c2i.net> X-Face: ?p&W)c( =?iso-8859-1?q?+80hU=3B=27=7B=2E=245K+zq=7BoC6y=7C=0A=09/D=27an*6mw?=>j'f:eBsex\Gi, Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-PMX-Version: 5.6.1.2065439, Antispam-Engine: 2.7.2.376379, Antispam-Data: 2013.1.14.145715 X-PMX-Spam: Gauge=IIIIIIII, Probability=8%, Report=' HTML_00_01 0.05, HTML_00_10 0.05, BODYTEXTP_SIZE_3000_LESS 0, BODY_SIZE_1600_1699 0, BODY_SIZE_2000_LESS 0, BODY_SIZE_5000_LESS 0, BODY_SIZE_7000_LESS 0, FROM_NAME_PHRASE 0, URI_ENDS_IN_HTML 0, __ANY_URI 0, __BOUNCE_CHALLENGE_SUBJ 0, __BOUNCE_NDR_SUBJ_EXEMPT 0, __CP_URI_IN_BODY 0, __CT 0, __CTE 0, __CT_TEXT_PLAIN 0, __HAS_FROM 0, __HAS_MSGID 0, __HAS_X_MAILING_LIST 0, __MIME_TEXT_ONLY 0, __MIME_VERSION 0, __SANE_MSGID 0, __TO_MALFORMED_2 0, __TO_NO_NAME 0, __URI_NO_WWW 0, __URI_NS , __USER_AGENT 0' Improved patch follows: --HPS From a88d72d2108f92f004a3f050a708d9b7f661f924 Mon Sep 17 00:00:00 2001 From: Hans Petter Selasky Date: Mon, 14 Jan 2013 13:53:21 +0100 Subject: [PATCH] Correctly initialize data for USB request. Found-by: Jan Beich Signed-off-by: Hans Petter Selasky --- drivers/input/tablet/wacom.h | 1 + drivers/input/tablet/wacom_sys.c | 8 +++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/input/tablet/wacom.h b/drivers/input/tablet/wacom.h index b79d451..d6fad87 100644 --- a/drivers/input/tablet/wacom.h +++ b/drivers/input/tablet/wacom.h @@ -89,6 +89,7 @@ #include #include #include +#include #include /* diff --git a/drivers/input/tablet/wacom_sys.c b/drivers/input/tablet/wacom_sys.c index f92d34f..23bc71e 100644 --- a/drivers/input/tablet/wacom_sys.c +++ b/drivers/input/tablet/wacom_sys.c @@ -553,10 +553,12 @@ static int wacom_set_device_mode(struct usb_interface *intf, int report_id, int if (!rep_data) return error; - rep_data[0] = report_id; - rep_data[1] = mode; - do { + memset(rep_data, 0, length); + + rep_data[0] = report_id; + rep_data[1] = mode; + error = wacom_set_report(intf, WAC_HID_FEATURE_REPORT, report_id, rep_data, length, 1); if (error >= 0)