Received: by 2002:a17:90a:1609:0:0:0:0 with SMTP id n9csp842148pja; Wed, 1 Apr 2020 09:40:51 -0700 (PDT) X-Google-Smtp-Source: ADFU+vu6Qkh8iz0PE2J5WTmaE+9dQ/26lflkemu6EcFJ4rWolelh27HGWdpffeodylJGCHONWa8z X-Received: by 2002:a05:6830:19ec:: with SMTP id t12mr7353716ott.24.1585759251452; Wed, 01 Apr 2020 09:40:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585759251; cv=none; d=google.com; s=arc-20160816; b=eKrvCd88dJvEWFhxjpSi4m5ZLTLxbtZnBHIVjkAvk5RWW9if5qT1d/fY8omIbJBr/M PXtQQ6Nf0oQ30Rs/HwXM1Dj1/ksFt99q+goCqlZnBgVHISVXRuNvrUhVnkoerZphywiI 7K2hypzxVOspo909z5HtjF3pjEr/8KCYHrSWEjrUSktWRc33wJj2VJ/ivN0WnO+1FjxQ GHkmsBfiWoDllkAYZktDA7t/QFOPH8QV5g28uI0eMOY9US+n9qc/5+ic7HUO4DjMPrzd ta1f9WQu1h8a7JoKvhDjdLC31Ta8peXv2d5+2U6XhxhL0FAzqRbiJmq4M8n60heM87Af +HJg== 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=YubE7hcK/QBZ5Yt1aHfimc99bYuYBiwwIqN+UI9YmEc=; b=xMqQOzUTwoYconymehNGQqv7txeSVo4Y5tIAxexNf09iYY052z4ExibgzwUdXjRv4c eyuTOsLxS7IexV1WkW8irHcxMZ6SRoyeFFV8EL8iE/MQSxreWVyRIrlEdcaEI43j0Frg VgBPDcCIspwmKiwRZ5g+WoJ51RdNGHjZrlfcpPfNlZJ+X4i68CrTCrsFXFaUuyO1IyK7 6yKZ8PigdaDfYxYFYIfL+Oq2QXUeYGW2tFiww9A4yihD7JSMZj1mAW7PTdRuKx7Fq3IO 3wANc7T2DK+Wrvb6m15NDCLnVC2PO3uIesj/AZD53jNmxVCsAsNncj82kLOFRWNCL4TP 8qUQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="gV/7Acod"; 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 y7si1171322ote.303.2020.04.01.09.40.38; Wed, 01 Apr 2020 09:40:51 -0700 (PDT) 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="gV/7Acod"; 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 S2389267AbgDAQj7 (ORCPT + 99 others); Wed, 1 Apr 2020 12:39:59 -0400 Received: from mail.kernel.org ([198.145.29.99]:40074 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388679AbgDAQj6 (ORCPT ); Wed, 1 Apr 2020 12:39:58 -0400 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 EBC6E2063A; Wed, 1 Apr 2020 16:39:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1585759197; bh=SNq0Obhjt+WPW0WDsUFSj46mTAZUvRRP6sKr3x9ynv0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gV/7AcodoUKbpP4AQmTD1HjUhNqR+CXChqQxRx6o+a//djVL8YXpIMQl7UwYGPCwT zFmayWlmulaJL4dmsJmBAHuwkmSZdEo0adfa/FEWE7kGWkdsU+WR7lSim1ZclhfGac ZJH8bCpsUmVNmGgBnOp2hfcGSsM376zh1eDm6uws= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Johan Hovold , Sean Young , Mauro Carvalho Chehab Subject: [PATCH 4.9 087/102] media: dib0700: fix rc endpoint lookup Date: Wed, 1 Apr 2020 18:18:30 +0200 Message-Id: <20200401161546.911682403@linuxfoundation.org> X-Mailer: git-send-email 2.26.0 In-Reply-To: <20200401161530.451355388@linuxfoundation.org> References: <20200401161530.451355388@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 f52981019ad8d6718de79b425a574c6bddf81f7c upstream. Make sure to use the current alternate setting when verifying the 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: c4018fa2e4c0 ("[media] dib0700: fix RC support on Hauppauge Nova-TD") Cc: stable # 3.16 Signed-off-by: Johan Hovold Signed-off-by: Sean Young Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Greg Kroah-Hartman --- drivers/media/usb/dvb-usb/dib0700_core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/drivers/media/usb/dvb-usb/dib0700_core.c +++ b/drivers/media/usb/dvb-usb/dib0700_core.c @@ -812,7 +812,7 @@ int dib0700_rc_setup(struct dvb_usb_devi /* Starting in firmware 1.20, the RC info is provided on a bulk pipe */ - if (intf->altsetting[0].desc.bNumEndpoints < rc_ep + 1) + if (intf->cur_altsetting->desc.bNumEndpoints < rc_ep + 1) return -ENODEV; purb = usb_alloc_urb(0, GFP_KERNEL); @@ -832,7 +832,7 @@ int dib0700_rc_setup(struct dvb_usb_devi * Some devices like the Hauppauge NovaTD model 52009 use an interrupt * endpoint, while others use a bulk one. */ - e = &intf->altsetting[0].endpoint[rc_ep].desc; + e = &intf->cur_altsetting->endpoint[rc_ep].desc; if (usb_endpoint_dir_in(e)) { if (usb_endpoint_xfer_bulk(e)) { pipe = usb_rcvbulkpipe(d->udev, rc_ep);