Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp2096195ybl; Thu, 30 Jan 2020 11:17:15 -0800 (PST) X-Google-Smtp-Source: APXvYqynIOBg3Gnt0XfLF5T7ZQ8M9i/VPHQ28lnAh4asMd3X3bVnaKKj35H3cjDAdfvkliH68zG4 X-Received: by 2002:a05:6808:8ee:: with SMTP id d14mr2667007oic.138.1580411835289; Thu, 30 Jan 2020 11:17:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580411835; cv=none; d=google.com; s=arc-20160816; b=CwhPq7Ut+BGlcDAHXMyT1l1Q0Kkuh1vB/hdNYBEHR/zdLCTLDk7n8d4os2mEfMCyLS XMiVT8ArPCBY0uzwPO1yeIM0B0HKWoaK2/WpQgKYfYK+6mrSVQpF/hQ6+AxGBOTaDiN7 pEAHaZfh2fSnVxU0P3CatJqP5jh1LxmVmBg24t+yDR6bsFdUklE7uE9IFhF/na22LFFX rK5iyA8KvCT0aSmwFAf0rfnb4/XF6shBcreTgDOict0WhTVJAKyda5UKTHAA9PW+Vx6e fbxqz8AwY30v6F47d1y9vebIHpAsDoNXCfGZQ2JfkLFxNYS8/zc1M2yMSNefAHxXf20K TPEg== 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=R1F0FsQNsFKuiKUeyle3B71NQ0cTl/kCOuclq7vr7Rw=; b=un+nk9YedFwGtXbsT79j1+UyJRHo6O4kObEE3Rvr3/PoezMVuM+PjJo/fSl6xWxWrP sYVFU+6bO+b/w2VXLVUhleld+JXIC3GloLKL+fu0s/gDx99HI+og2xbv3kAqFb7f+u47 LK2TtEmVfpiv6RQYjszkj+b9F90RzHeD2wI+Rrwg8HiJck6bBKlSw9AGqRgZ/nTEi6BP 6rY1+Tsnl1/x4s4Sl1OMZLWAxtS2Itll1/++9Og7I/gWnnud2UFYYS/g7ul1MdXvzGEJ HkNjjutAKdpvlQn7lw4p0opqBOaKR/uQQX0PwpMmQTHTZ631zaID73fXDokCfzHgxDrA BxmA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=M7iiql+I; 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 y6si2954711oih.217.2020.01.30.11.17.02; Thu, 30 Jan 2020 11:17:15 -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=M7iiql+I; 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 S1730558AbgA3SnN (ORCPT + 99 others); Thu, 30 Jan 2020 13:43:13 -0500 Received: from mail.kernel.org ([198.145.29.99]:51604 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730524AbgA3SnE (ORCPT ); Thu, 30 Jan 2020 13:43:04 -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 B2D60205F4; Thu, 30 Jan 2020 18:43:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1580409784; bh=JR1RwpBMjLTWErhKmNkJO3sfcrMLDq74tnVgsfQQTM8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=M7iiql+I2MR6HhmE2hVXfBp3sDIJPiyW+vgkV1piUZKuxNRZdkOA6Xp7i+vRXagJU 57aXosqqVJMfu8UNuzmunTeG6xBK239ebskNUVraTRDM4zkAcCPzyWPl4EkgYnCXjB ya+YTCQT00FwhvEmPYHRSTq5fdNxWi/3JnyQMkGE= 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 031/110] ath9k: fix storage endpoint lookup Date: Thu, 30 Jan 2020 19:38:07 +0100 Message-Id: <20200130183619.070047346@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 0ef332951e856efa89507cdd13ba8f4fb8d4db12 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: 36bcce430657 ("ath9k_htc: Handle storage devices") Cc: stable # 2.6.39 Signed-off-by: Johan Hovold Signed-off-by: Kalle Valo Signed-off-by: Greg Kroah-Hartman --- drivers/net/wireless/ath/ath9k/hif_usb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/net/wireless/ath/ath9k/hif_usb.c +++ b/drivers/net/wireless/ath/ath9k/hif_usb.c @@ -1216,7 +1216,7 @@ err_fw: static int send_eject_command(struct usb_interface *interface) { struct usb_device *udev = interface_to_usbdev(interface); - struct usb_host_interface *iface_desc = &interface->altsetting[0]; + struct usb_host_interface *iface_desc = interface->cur_altsetting; struct usb_endpoint_descriptor *endpoint; unsigned char *cmd; u8 bulk_out_ep;