Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp3288973ybb; Tue, 31 Mar 2020 02:10:53 -0700 (PDT) X-Google-Smtp-Source: ADFU+vtWQlsR2ce1v4qWD3uawXX03SVdyO+O1VX8HpnJ0kvSqgRId+O+Pcy2iJHw1ZGWOkDTH+OM X-Received: by 2002:aca:5194:: with SMTP id f142mr1448269oib.100.1585645853388; Tue, 31 Mar 2020 02:10:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585645853; cv=none; d=google.com; s=arc-20160816; b=k8lrwwkMNucZiozw48yRwjgRxnOyDyEsno0+gq6FDvgBCoM6Ljow0aTfEErmldO2b6 xzAIf/fzl1Jc+bo26yrikfdbJknBDckVk6uSWVQbVVgT1W7xrG5keNNnkAGvGdlDTX8j Pp4uNCrY0o4XlpGKQJlIFPeCwGkHI4RrEsZnheEm+Hy8kWdzTNrhKdrPEVxjOlk5xlK2 wYrecksGzvRKlcYAtFgsHPwxLba9xxpowqZW3ztquwumk+QR/dLNrf1BT+2NT3bedBHv lPQ6SOlL2pp8bVCexQBg5CQsO9LZY9iJW2f9bM1xlhXjr0oXZtoHydzIu6IbKDo7NKil gAkA== 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=tuWWsNVS7Km80lYbY/ADaPX6Y5f76z20Z55Y690mxoo=; b=yiPAkZN57h9V1zMfuEEbnb1HrPy3wAvHHxLGPx4oCgxjHU4Z8+bX55BPbOcfPB/G0r Ie9tESgfHIaO62r3QHqdOvWOTHzDS+D7k641t0TB8NgXOSe4BzlogHDjlIhvFyyRwtTX K3IyTwyjKhrHhUqjoQhJIwUIpDBShwOkZ34L0+3Hhpxf/z68rubCmpkOwhp1OisgplbU jzSf1m7/6LZNPqtIS7s0KsjYs5xK3htEp6CPVJqYhy371Juk7u6aNIDWVOpyiEJY705I +hlG9VLREbpPBsIGGLNLi2ysuwgumqBwlxudIRanLVZqjvOiPi/So2yRLRKCq6YRwO2t TDLw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=NQBuEcrj; 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 z14si7672190oom.72.2020.03.31.02.10.41; Tue, 31 Mar 2020 02:10:53 -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=NQBuEcrj; 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 S1731278AbgCaJJ5 (ORCPT + 99 others); Tue, 31 Mar 2020 05:09:57 -0400 Received: from mail.kernel.org ([198.145.29.99]:53390 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731288AbgCaJJy (ORCPT ); Tue, 31 Mar 2020 05:09:54 -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 F218220787; Tue, 31 Mar 2020 09:09:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1585645794; bh=xvffDx0hCiYBgpQXCUZCW3SlnbePQdBwZt9YeMDHd/U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NQBuEcrjKDaNQui9/bTd07Xh2mUzFo4z+rm21kpT17L4mkbmfXWQRNbN6QHOgUqwS JC2Xvl+XbpHllNwgysuXJnazl2MwuI4kWeliHsSEb7Sk7V/ps6BylNT+KGoN+u705u h3/0I2/4opN5qpcfgwsIRmWCYg1gKHJ9HnKTqhQU= 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 5.5 167/170] media: dib0700: fix rc endpoint lookup Date: Tue, 31 Mar 2020 10:59:41 +0200 Message-Id: <20200331085440.398721313@linuxfoundation.org> X-Mailer: git-send-email 2.26.0 In-Reply-To: <20200331085423.990189598@linuxfoundation.org> References: <20200331085423.990189598@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 @@ -818,7 +818,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); @@ -838,7 +838,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);