From patchwork Wed Jun 27 02:33:56 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Herrenschmidt X-Patchwork-Id: 10490427 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id B395560532 for ; Wed, 27 Jun 2018 02:36:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A175B28A10 for ; Wed, 27 Jun 2018 02:36:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9345428A4A; Wed, 27 Jun 2018 02:36:25 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 409CB28A10 for ; Wed, 27 Jun 2018 02:36:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753086AbeF0CgX (ORCPT ); Tue, 26 Jun 2018 22:36:23 -0400 Received: from gate.crashing.org ([63.228.1.57]:46793 "EHLO gate.crashing.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752574AbeF0CgW (ORCPT ); Tue, 26 Jun 2018 22:36:22 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.14.1) with ESMTP id w5R2XuSf032384; Tue, 26 Jun 2018 21:33:58 -0500 Message-ID: <9bdeb564e28334a630f9b1c125b563d757068682.camel@kernel.crashing.org> Subject: [PATCH] usb: gadget: Fix OS descriptors support From: Benjamin Herrenschmidt To: linux-usb@vger.kernel.org Cc: Alan Stern , Felipe Balbi , Chris Dickens , Joel Stanley Date: Wed, 27 Jun 2018 12:33:56 +1000 X-Mailer: Evolution 3.28.2 (3.28.2-1.fc28) Mime-Version: 1.0 Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The current code is broken as it re-defines "req" inside the if block, then goto out of it. Thus the request that ends up being sent is not the one that was populated by the code in question. This fixes RNDIS driver autodetect by Windows 10 for me. The bug was introduced by Chris rework to remove the local queuing inside the if { } block of the redefined request. Signed-off-by: Benjamin Herrenschmidt Fixes: 636ba13aec8a ("usb: gadget: composite: remove duplicated code in OS desc handling") CC: stable@vger.kernel.org [v4.17] --- drivers/usb/gadget/composite.c | 1 - 1 file changed, 1 deletion(-) -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/usb/gadget/composite.c b/drivers/usb/gadget/composite.c index f242c2bcea81..abc21db2632d 100644 --- a/drivers/usb/gadget/composite.c +++ b/drivers/usb/gadget/composite.c @@ -1816,7 +1816,6 @@ composite_setup(struct usb_gadget *gadget, const struct usb_ctrlrequest *ctrl) if (cdev->use_os_string && cdev->os_desc_config && (ctrl->bRequestType & USB_TYPE_VENDOR) && ctrl->bRequest == cdev->b_vendor_code) { - struct usb_request *req; struct usb_configuration *os_desc_cfg; u8 *buf; int interface;