From patchwork Mon Feb 10 12:32:26 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 231762 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9520AC352A4 for ; Mon, 10 Feb 2020 13:16:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 64AFE2070A for ; Mon, 10 Feb 2020 13:16:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1581340592; bh=fQAz3IvNxpOZZlPxtQGQqgPRu0k0bCDbi1STD+6Z5M8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=req6yMyoAxRjVy5yUSPtfic/XiAis7UQTuK6HNjBM4MFjfAQFBM/KxoR5a6j+HmEd VKNSAR9T8gnXMbGTH2O/WOMOE3UCemQ3ll+pSfZC1diLVqC1Nz4rbOkQ5bgDpSO4AE 9QZ/qgOAIEGj4O3kPJ+6geg+LypQiIxbVpjJ7wwg= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729037AbgBJNQb (ORCPT ); Mon, 10 Feb 2020 08:16:31 -0500 Received: from mail.kernel.org ([198.145.29.99]:33054 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729033AbgBJMiJ (ORCPT ); Mon, 10 Feb 2020 07:38:09 -0500 Received: from localhost (unknown [209.37.97.194]) (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 1675D20733; Mon, 10 Feb 2020 12:38:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1581338289; bh=fQAz3IvNxpOZZlPxtQGQqgPRu0k0bCDbi1STD+6Z5M8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ColV959AZjdM15tpzwdlEG11g0c8FPvq0Xut7guR0aFq1juOJztLsC1kLS3b0AS4u jUZV/jE3xV6S5XCqYUGV4GBYpdv9jJ3gP5fRkdon9Ow3FkNnnCZuP3xaGV446KFcOl hAhrcHKxHp4K+L4O26EZ+qACMYDDnnTbuohGise8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Oliver Neukum , Johan Hovold , Sean Young , Mauro Carvalho Chehab Subject: [PATCH 5.4 190/309] media: iguanair: fix endpoint sanity check Date: Mon, 10 Feb 2020 04:32:26 -0800 Message-Id: <20200210122424.808494428@linuxfoundation.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200210122406.106356946@linuxfoundation.org> References: <20200210122406.106356946@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Johan Hovold commit 1b257870a78b0a9ce98fdfb052c58542022ffb5b upstream. Make sure to use the current alternate setting, which need not be the first one by index, when verifying the endpoint descriptors and initialising the URBs. 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: 26ff63137c45 ("[media] Add support for the IguanaWorks USB IR Transceiver") Fixes: ab1cbdf159be ("media: iguanair: add sanity checks") Cc: stable # 3.6 Cc: Oliver Neukum Signed-off-by: Johan Hovold Signed-off-by: Sean Young Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Greg Kroah-Hartman --- drivers/media/rc/iguanair.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/media/rc/iguanair.c +++ b/drivers/media/rc/iguanair.c @@ -413,7 +413,7 @@ static int iguanair_probe(struct usb_int int ret, pipein, pipeout; struct usb_host_interface *idesc; - idesc = intf->altsetting; + idesc = intf->cur_altsetting; if (idesc->desc.bNumEndpoints < 2) return -ENODEV;