Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp2096264ybl; Thu, 30 Jan 2020 11:17:20 -0800 (PST) X-Google-Smtp-Source: APXvYqx2f8kjPVB7kowezZiIu0lFP6zvWLdiK97QsU7PDuryXOi6ZvHccmkrhuQ3MoPNF7Uu/V8m X-Received: by 2002:a9d:6c01:: with SMTP id f1mr4593592otq.133.1580411839691; Thu, 30 Jan 2020 11:17:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580411839; cv=none; d=google.com; s=arc-20160816; b=KZhU5nXstDhnw7afPs1fz0OFxgEV/O7A1vqeAgs0qzUzEsZVnhw0kP0QzLUSEbuPRY s4qdc3yJUFU1peurC7xwN6tbO2jMgHnkTnVYI9CHdW41QKgvo+7V58ZyzS7zqXok7e5W tOif2HvwdYuRq/oG/vxCr0bPnrF0Yz9fUpEXDCPi8m3T5f11gsnOjIkmkUlAuU3NJUUi /f5CEquR/4oFz2mYvRrBoLCc7H4/RZaK5RELcqEBC+MewtlsCEHlIbeVJUzKmcvjlNKa QGTdYgu4skmZDe0rKHm0oqQGj0d2G6Pm4JU5v+Oq+LL90tcErfXIdoSFMtEK9872qD15 T/TA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=iT8LLX7UuulhUPbyGv7iNpQKUCc5DkeQynU9deGMbOg=; b=YPiy3xY9WXZfJhM5wpHExOGbFikU/T9o3exrNaCe5OOMlKBDXLzad5eqO7kFvwIbRu +puPGFpW8kCDj9ACRGUOEZJVx14+4T5arcdPdnpqkX/hhaUT/C3ygyz64Qk1yYhMhgoL VWQ7D59cA1Feaks0E9sNrbHeeHaNPvilelmUVRT0QI/aq8ILCG/3+Z//tUwpR6mtMrZl 6SZe4gRu+e6OwKMR0SxmMFFyII361mZ+87jQMHwgtR1GCFyI4JrxMZVhHmoHPLnDRIW3 YjftOy0C9VWKrn7dcLmhW6Kc3pW1RbLRysWCbMD2TnxGaAtruGkNj1kv9k1trDnuJ5j8 mpJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Nx6M1pyU; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e192si2928453oib.82.2020.01.30.11.17.07; Thu, 30 Jan 2020 11:17:19 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Nx6M1pyU; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730579AbgA3SnT (ORCPT + 99 others); Thu, 30 Jan 2020 13:43:19 -0500 Received: from mail.kernel.org ([198.145.29.99]:51754 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730553AbgA3SnM (ORCPT ); Thu, 30 Jan 2020 13:43:12 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 1C2F42083E; Thu, 30 Jan 2020 18:43:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1580409791; bh=HmDDopOrwhUHL1wldJ0BrLZPmR8N2AVoVwZoXxGPi00=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Nx6M1pyU6VJhQVoCubmJ2RpXesHnSCpdvoPQ7lkxVqqFad+b55c3rb7Ei9jz9trGA osqf7XQUhmFCTlHdQZuSU21DDMLp1DRCESZB23xXtBoZDGzpg6k9ff4desuKuZtPqo FdCOltmzEf5uvznNfb3ZwXZKRrLY5ZXmNDDd7XPI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Johan Hovold , Kalle Valo Subject: [PATCH 5.4 034/110] zd1211rw: fix storage endpoint lookup Date: Thu, 30 Jan 2020 19:38:10 +0100 Message-Id: <20200130183619.396586701@linuxfoundation.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200130183613.810054545@linuxfoundation.org> References: <20200130183613.810054545@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Johan Hovold commit 2d68bb2687abb747558b933e80845ff31570a49c upstream. Make sure to use the current alternate setting when verifying the storage interface descriptors to avoid submitting an URB to an invalid endpoint. Failing to do so could cause the driver to misbehave or trigger a WARN() in usb_submit_urb() that kernels with panic_on_warn set would choke on. Fixes: a1030e92c150 ("[PATCH] zd1211rw: Convert installer CDROM device into WLAN device") Cc: stable # 2.6.19 Signed-off-by: Johan Hovold Signed-off-by: Kalle Valo Signed-off-by: Greg Kroah-Hartman --- drivers/net/wireless/zydas/zd1211rw/zd_usb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/net/wireless/zydas/zd1211rw/zd_usb.c +++ b/drivers/net/wireless/zydas/zd1211rw/zd_usb.c @@ -1263,7 +1263,7 @@ static void print_id(struct usb_device * static int eject_installer(struct usb_interface *intf) { struct usb_device *udev = interface_to_usbdev(intf); - struct usb_host_interface *iface_desc = &intf->altsetting[0]; + struct usb_host_interface *iface_desc = intf->cur_altsetting; struct usb_endpoint_descriptor *endpoint; unsigned char *cmd; u8 bulk_out_ep;