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: 1972511 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 0AC58DF23A for ; Mon, 14 Jan 2013 15:05:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756345Ab3ANPE5 (ORCPT ); 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 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)