Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2729306pxj; Mon, 31 May 2021 09:15:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxqOO9Rkl4WFkXduyP0hxQ7OQ7rAes74CRWlYviwfEIcfJL+nXoCnlzKk98BKPwoknCmezH X-Received: by 2002:a02:354c:: with SMTP id y12mr21159287jae.144.1622477747915; Mon, 31 May 2021 09:15:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622477747; cv=none; d=google.com; s=arc-20160816; b=fE1KknTEcrW8p8T1yLu9plkIOh1cWTkln4QNZmqGDDfDbmn74T4d1IC52y2RoNZ3Hl HBhPhPe3nLO9DPLhZKPL2JWu/jH8xL/A8gXJWzechCXKy+e4WNoh9o3uRU79mbWkJpXp jfrYeJSPHYy0nQHa1n2xwlzhHxX55LQLJWqZFZCnG7Y0JEiYAEMv7OqgPzMpIOIoZP4a xuCfouXLUbyRWUURItYyjXmPWZjeud8ssnvXFZnWUvgiejrDSO+7CmzlsuzdszqdKG1Z AxR2DI3KP6lVdkrf/Whsx0Ogql75TXbWkDtHqye4BJZ2fH+NmF4Ga0T8qw7sEMNmH9e6 0CRg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=bmwV+rro/WAu1jpOvlecmXOqZ1LPUYNmT8bD6MJKc5c=; b=u+tQDFPP/UP3TI8Qd0L7Z/Eo5eh9yVVK1Chg8o58fb01u7LyTaqk0aTXfx1e6m91to ZrCAkaL1a/vjfYh9P8KygQhDAFNOPC6VXCN0poIaUFofh4p/Y89mSYB25vRN8zVGRIZc 3VrnwSV76rY1iZZdDesvvG7H9NAE9MwTKAERqm2Ro5xaD8LajZBdpekinvi32NI8ipSw VDzA8LvdkpKgPGrU6iFrys9M/lTHgjQzbaUyOoVnZ8WsS8r2stRVADiaWi+S9HnBrf1a 2neFTceNnIboeklucEyXWY4mTm9DD/A7B0nAXk/ywNn2Jp0X31oMJs8ai7uqdrBGmije pLpQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="i1kX/qiU"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p12si13551925ilq.5.2021.05.31.09.15.34; Mon, 31 May 2021 09:15:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="i1kX/qiU"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233734AbhEaQPR (ORCPT + 99 others); Mon, 31 May 2021 12:15:17 -0400 Received: from mail.kernel.org ([198.145.29.99]:37968 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234145AbhEaOjb (ORCPT ); Mon, 31 May 2021 10:39:31 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 973B461C5D; Mon, 31 May 2021 13:52:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1622469156; bh=48Soh6RnlXypW8APZSOeTcy38VcdKuzc9LqZpppiBno=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=i1kX/qiUM9Yxz36cMjPPipUCJqEkkNbeqQs18qgl+9ltBVtDsXWLHN5x33vqfcol1 sGyUPLj+eBickjHRFProKt1WjZN+Fs5YAB9kEADMP/IwFNZzUviGx48Lv5C/JOz/OY CGjVzc6ZYKq1Bg1nQckelR+4bSFCTu/AM+p5WS7A= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Johan Hovold Subject: [PATCH 5.12 089/296] USB: trancevibrator: fix control-request direction Date: Mon, 31 May 2021 15:12:24 +0200 Message-Id: <20210531130706.892185856@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210531130703.762129381@linuxfoundation.org> References: <20210531130703.762129381@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Johan Hovold commit 746e4acf87bcacf1406e05ef24a0b7139147c63e upstream. The direction of the pipe argument must match the request-type direction bit or control requests may fail depending on the host-controller-driver implementation. Fix the set-speed request which erroneously used USB_DIR_IN and update the default timeout argument to match (same value). Fixes: 5638e4d92e77 ("USB: add PlayStation 2 Trance Vibrator driver") Cc: stable@vger.kernel.org # 2.6.19 Signed-off-by: Johan Hovold Link: https://lore.kernel.org/r/20210521133109.17396-1-johan@kernel.org Signed-off-by: Greg Kroah-Hartman --- drivers/usb/misc/trancevibrator.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/drivers/usb/misc/trancevibrator.c +++ b/drivers/usb/misc/trancevibrator.c @@ -61,9 +61,9 @@ static ssize_t speed_store(struct device /* Set speed */ retval = usb_control_msg(tv->udev, usb_sndctrlpipe(tv->udev, 0), 0x01, /* vendor request: set speed */ - USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_OTHER, + USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_OTHER, tv->speed, /* speed value */ - 0, NULL, 0, USB_CTRL_GET_TIMEOUT); + 0, NULL, 0, USB_CTRL_SET_TIMEOUT); if (retval) { tv->speed = old; dev_dbg(&tv->udev->dev, "retval = %d\n", retval);