Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2631353pxj; Mon, 14 Jun 2021 03:32:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxeHhUwvq3iHwEEcoA9gbPTsvevnBVdgYWNEY+6sP2gY26mW0LXl1LYVGetan9H6DZ+00Yz X-Received: by 2002:a05:6402:51cf:: with SMTP id r15mr15916589edd.263.1623666740079; Mon, 14 Jun 2021 03:32:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623666740; cv=none; d=google.com; s=arc-20160816; b=tGzhYl5P93yEoaOIQCpA7c2+myv6obuPI3+QbnzsHaKhgJ8pCbx7Wc3HKOphv9dd9G U85ABQj26c9Mim0+c9tzawBZ/GTnBzbY7X87WmCVFNvWObozryBcfOvCoMgowBgLIBD4 J3oPYyXYiR7aiiYJo2vaXGKbZB/brV8XBqUfh2KXwv8fF6EgaWPtagz6O8gr8oupesLW T+fHZU8bx5Qi6OjJWRwTrG9TIBv/wti7fKPh1SbhJrg+46A/eSGn4ycrJxXlHCRJrN8l 0nYr4E2qVoF7acVmXoWmBiLuk99VtX/WyFOhWaQB2L6nq5Vf1lcnecinuwCe7FhOwMZ6 YC8w== 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=SgDVO6DcLKXOtVm3VR5vlq6VnsE+eiz4duqzpt0pfpY=; b=rSGvH580zhkWPT1OrKpO08foWG5ZJ7dtoEf2esKAdPbAsf2MobA+bmafnQO0txAV4e IiZvqjPW0vfFWR5WCH7k9ayOClSIzgsvrwKBXZKv0z/60kEoNrIDKK1dWiz1xaoo8k64 85wti6i3IDkFW7luPuJWDGwf8OGuXOxjf63yVk7yWB/0yfugLTg/n6v1fMiY+GwMumYc 2TSwtHk/QFCkWxRJ2t3IE7WI7anE74XYmZSbGy0RkZv4M6kU2fiVoUoZVFuJjalmLJgE f+Huwrtu6AchlOTRdA8N0sw1OuthOKXz09IkQKqJGBn5SG84lYTphTehrUWhmqh5ScPg 9XFw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=YgNCOnGq; 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 12si7859739ejg.74.2021.06.14.03.31.56; Mon, 14 Jun 2021 03:32:20 -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=YgNCOnGq; 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 S233011AbhFNKca (ORCPT + 99 others); Mon, 14 Jun 2021 06:32:30 -0400 Received: from mail.kernel.org ([198.145.29.99]:38226 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232911AbhFNKba (ORCPT ); Mon, 14 Jun 2021 06:31:30 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 3C387611C0; Mon, 14 Jun 2021 10:29:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1623666567; bh=garON5RXTgVwCiYSp8F7v2qJyPtTNSWSja2qsVwO0NE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YgNCOnGqkkypU9KU2pXYvoagSgAgy2ZsOWA6bbdtHjJ1jlJQSs4SvEBDoExHHNQ1z KO0Z/G1gl77RfF1nLFAAD6rvskU99HOP+KDynPndQ46vBp9XmoIuYqlAVCFoGwjAnl lTxj8Db3ptBZXzJH74HJHl7slatFjXg3Yelhg/Sc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Johan Hovold Subject: [PATCH 4.4 26/34] USB: serial: quatech2: fix control-request directions Date: Mon, 14 Jun 2021 12:27:17 +0200 Message-Id: <20210614102642.422090356@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210614102641.582612289@linuxfoundation.org> References: <20210614102641.582612289@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 eb8dbe80326c3d44c1e38ee4f40e0d8d3e06f2d0 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 three requests which erroneously used usb_rcvctrlpipe(). Fixes: f7a33e608d9a ("USB: serial: add quatech2 usb to serial driver") Cc: stable@vger.kernel.org # 3.5 Signed-off-by: Johan Hovold Signed-off-by: Greg Kroah-Hartman --- drivers/usb/serial/quatech2.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) --- a/drivers/usb/serial/quatech2.c +++ b/drivers/usb/serial/quatech2.c @@ -419,7 +419,7 @@ static void qt2_close(struct usb_serial_ /* flush the port transmit buffer */ i = usb_control_msg(serial->dev, - usb_rcvctrlpipe(serial->dev, 0), + usb_sndctrlpipe(serial->dev, 0), QT2_FLUSH_DEVICE, 0x40, 1, port_priv->device_port, NULL, 0, QT2_USB_TIMEOUT); @@ -429,7 +429,7 @@ static void qt2_close(struct usb_serial_ /* flush the port receive buffer */ i = usb_control_msg(serial->dev, - usb_rcvctrlpipe(serial->dev, 0), + usb_sndctrlpipe(serial->dev, 0), QT2_FLUSH_DEVICE, 0x40, 0, port_priv->device_port, NULL, 0, QT2_USB_TIMEOUT); @@ -701,7 +701,7 @@ static int qt2_attach(struct usb_serial int status; /* power on unit */ - status = usb_control_msg(serial->dev, usb_rcvctrlpipe(serial->dev, 0), + status = usb_control_msg(serial->dev, usb_sndctrlpipe(serial->dev, 0), 0xc2, 0x40, 0x8000, 0, NULL, 0, QT2_USB_TIMEOUT); if (status < 0) {