Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2691541pxj; Mon, 31 May 2021 08:21:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxm/12KJJMdaV3UEe20gVYyNdhdVMhIQmgwdxXJWLdbn2GAtV65BydqDQ0LGgrPBnNGc4pD X-Received: by 2002:a17:907:33d0:: with SMTP id zk16mr11498524ejb.144.1622474498986; Mon, 31 May 2021 08:21:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622474498; cv=none; d=google.com; s=arc-20160816; b=mjnNAzE9PQSrY1kIP3gYb/9O0W9JIU5QaShShB7ypMdTXP6jZFFsx+aCr+Y1eBo5gH 3Rw6yL7CtY2og2atRDoXn/p31A/RYjgbPhxBglhHQM9/qIBPGHfxUT+ouV6U3LLJ6V0G XqLcuaV9ekH768W8uNYQlXzzmzfQgYFEgF71QF9zjDQzURfX2nuOT1DeYh9AAQyQPAK2 ZJ/Gme6GIbbgPciPhZ/ipIViM/SQIg7mL9z5vHD3J5txVSucdsULA14vU2o4A/b7ChzY Xh4Rx88e875TCLX7egzEhBUNKvtCduDlPefj2WXeHsLOZdTvXjMze8BJf+L33IvQSZtf xqCg== 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=1HicF5JcZVPMS0DQ5YpwwkR9dS5vdlw4ZY+ETGZTEws=; b=i/ftYOHgeu1/xyuOW9wEiprqC1nEEGTTlOjAPUlOEy0gC2sKcPCbgvRoHbOOd3IpJb 4YYF8GlAH4zf3GNGBAeYXqiMBXRAfFiUFpvZ5ewnr7Fjo8z5rzVhwznXP01oLCuJPU6b WoTh0FP7EUxrx1QX+KHCkjANMt4AXyX/ZrG6YNqJ7l6mU79F16h1uERqp6DIKlhMhDAP GOvvvYNmtZHIHHQpzU+4qrtiMRwaYh2prk4FP9nU1H67KaukHk8WTdQYjAto8VN0hHqo LUqOVWtqFdgaoaJExyDXeaQ2SWFFQDBA4yuXNoEOz6yML6B5ez2xb+n6bMd4NS3Ct47n LvdA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=D4zGMpcz; 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 w7si11433839edc.254.2021.05.31.08.21.16; Mon, 31 May 2021 08:21:38 -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=D4zGMpcz; 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 S232979AbhEaPVm (ORCPT + 99 others); Mon, 31 May 2021 11:21:42 -0400 Received: from mail.kernel.org ([198.145.29.99]:43696 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231239AbhEaOP7 (ORCPT ); Mon, 31 May 2021 10:15:59 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 1CC5161476; Mon, 31 May 2021 13:43:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1622468588; bh=yJaSPk+SA3ZD/Iq4qFmrm8UN3AxhOPuQ3d7rZwmtAN4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=D4zGMpcz94aDM38j0o1c3KwrOwlAUH0MzXwFUxnPzs7Oal3fqq5ND3xdTTuE0Z/Fb HX7gBF0z9WCzx9QzKoETgISaiOLDnFsBs1WnWYu7s30xBkLp7wKSnvK9Fd40DHVBAJ 5kIYQP/EXpYobqqZNmxdqVRmuXZ9wqSn7UnTUfrg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Johan Hovold , "David S. Miller" Subject: [PATCH 5.4 013/177] net: hso: fix control-request directions Date: Mon, 31 May 2021 15:12:50 +0200 Message-Id: <20210531130648.370093307@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 1a6e9a9c68c1f183872e4bcc947382111c2e04eb 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 tiocmset and rfkill requests which erroneously used usb_rcvctrlpipe(). Fixes: 72dc1c096c70 ("HSO: add option hso driver") Cc: stable@vger.kernel.org # 2.6.27 Signed-off-by: Johan Hovold Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/net/usb/hso.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/drivers/net/usb/hso.c +++ b/drivers/net/usb/hso.c @@ -1689,7 +1689,7 @@ static int hso_serial_tiocmset(struct tt spin_unlock_irqrestore(&serial->serial_lock, flags); return usb_control_msg(serial->parent->usb, - usb_rcvctrlpipe(serial->parent->usb, 0), 0x22, + usb_sndctrlpipe(serial->parent->usb, 0), 0x22, 0x21, val, if_num, NULL, 0, USB_CTRL_SET_TIMEOUT); } @@ -2436,7 +2436,7 @@ static int hso_rfkill_set_block(void *da if (hso_dev->usb_gone) rv = 0; else - rv = usb_control_msg(hso_dev->usb, usb_rcvctrlpipe(hso_dev->usb, 0), + rv = usb_control_msg(hso_dev->usb, usb_sndctrlpipe(hso_dev->usb, 0), enabled ? 0x82 : 0x81, 0x40, 0, 0, NULL, 0, USB_CTRL_SET_TIMEOUT); mutex_unlock(&hso_dev->mutex);