Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2703422pxj; Mon, 31 May 2021 08:38:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzNqwsc5r2xFhZBB0mskw0KUhojIXbYdCD0JwhnlRItTKxp2BRdQKopIOb6KMhlrRcWnHX7 X-Received: by 2002:a17:907:3f27:: with SMTP id hq39mr18272361ejc.520.1622475505003; Mon, 31 May 2021 08:38:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622475504; cv=none; d=google.com; s=arc-20160816; b=Re2zx7O1U275ZJFm1FVBotM7/n4kinTPxzw5nXOzHQlfEe9m6zLXbeYV/abTGUWxe2 2KJs5Z6cZZCoK4LpLpAH2vqDw+KXcivjkvseNtO1RKyYeiXX4zSdibm/wgOHxM57vN9t 7IeKm/rPJJdX+LQTy4EsDA/g/2CUTOgy4YVJv6ZWcptiVPxIMjKgO7XZWrYyByg2MxPl C2j1YSWMbmcuZvuBFxx9hvZL7m/N24ygkw028s6IbKloPd6xqrSILMSuXMpE1o2G36U/ W0i/QH5ZJsHk134u4uDh+1BiDK1HoCQEaNndoRbT+dIlEqjNjK5bwdO5gyAagkhOrWZp OT1A== 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=dKfH1nuyYP4ECS1ncTFWLICIJlaecpjK+nRskLWEt9aXr24VeSD0LFwaJpgVBACHJH Rj/JSJZw1OqtlmJ20l2LgF+EgXevGSQoxW1P+ZxrL4xwE+Z4RXM3F0JBOfqE+fTutPmz IKeL0mtuwZsZ7ew/aLKOG/5ceowyiPPbNU8vtINN3LJn+j1btnTkxJ7qFyh+So5O3oQG 7xStgwoXpoUwrieaXzraU/GF2Ljt/pn3OYs9zU1ACL1mn9oh19q8CtJ1Jz5uuM06ZHtD 63vgFF1wcCCXTz4VgA659pqSkeAGWzp/51dw2FsK5Xc2jVKZZJGSlzmvNtbw2SYyT6YK p22Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="C8/vG3Hy"; 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 ba29si12316922edb.137.2021.05.31.08.38.02; Mon, 31 May 2021 08:38:24 -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="C8/vG3Hy"; 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 S232171AbhEaPiI (ORCPT + 99 others); Mon, 31 May 2021 11:38:08 -0400 Received: from mail.kernel.org ([198.145.29.99]:48832 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233808AbhEaOVb (ORCPT ); Mon, 31 May 2021 10:21:31 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id DBC54619C3; Mon, 31 May 2021 13:44:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1622468683; bh=48Soh6RnlXypW8APZSOeTcy38VcdKuzc9LqZpppiBno=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=C8/vG3HyehClutTVjrnXk+pZ0GYvJApUqoIfW+1Pwro7bcOfBCXaSdq24w63yS9mZ FrDPYv+f4v5GHlc2ah6XY8pfAC1WX0Gi7id1dDNQRNYWlFnkS4i7YQprEr/ptMOqdB FEUcYDffKLK3Yb2bQ4U9nVJdlIvjOUgzNjOwL/yM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Johan Hovold Subject: [PATCH 5.4 051/177] USB: trancevibrator: fix control-request direction Date: Mon, 31 May 2021 15:13:28 +0200 Message-Id: <20210531130649.693833870@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210531130647.887605866@linuxfoundation.org> References: <20210531130647.887605866@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);