From patchwork Mon Oct 18 18:39:17 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Shtylyov X-Patchwork-Id: 12567699 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D0C3FC433EF for ; Mon, 18 Oct 2021 18:39:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BDD0F6134F for ; Mon, 18 Oct 2021 18:39:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233485AbhJRSly (ORCPT ); Mon, 18 Oct 2021 14:41:54 -0400 Received: from mxout04.lancloud.ru ([45.84.86.114]:55488 "EHLO mxout04.lancloud.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233186AbhJRSlu (ORCPT ); Mon, 18 Oct 2021 14:41:50 -0400 Received: from LanCloud DKIM-Filter: OpenDKIM Filter v2.11.0 mxout04.lancloud.ru B795D20A8F94 Received: from LanCloud Received: from LanCloud Received: from LanCloud From: Sergey Shtylyov To: , Alan Stern , "Greg Kroah-Hartman" Subject: [PATCH 09/22] usb: host: ohci-da8xx: deny IRQ0 Date: Mon, 18 Oct 2021 21:39:17 +0300 Message-ID: <20211018183930.8448-10-s.shtylyov@omp.ru> X-Mailer: git-send-email 2.26.3 In-Reply-To: <20211018183930.8448-1-s.shtylyov@omp.ru> References: <20211018183930.8448-1-s.shtylyov@omp.ru> MIME-Version: 1.0 X-Originating-IP: [192.168.11.198] X-ClientProxiedBy: LFEXT01.lancloud.ru (fd00:f066::141) To LFEX1907.lancloud.ru (fd00:f066::207) Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org If platform_get_irq() returns IRQ0 (considered invalid according to Linus) the driver blithely passes it to usb_add_hcd() that treats IRQ0 as no IRQ at all. Deny IRQ0 right away, returning -EINVAL from the probe() method... Fixes: efe7daf2231a ("USB: OHCI: DA8xx/OMAP-L1x glue layer") Signed-off-by: Sergey Shtylyov --- drivers/usb/host/ohci-da8xx.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/usb/host/ohci-da8xx.c b/drivers/usb/host/ohci-da8xx.c index 1371b0c249ec..6d08ab2bf163 100644 --- a/drivers/usb/host/ohci-da8xx.c +++ b/drivers/usb/host/ohci-da8xx.c @@ -449,6 +449,10 @@ static int ohci_da8xx_probe(struct platform_device *pdev) error = -ENODEV; goto err; } + if (!hcd_irq) { + error = -EINVAL; + goto err; + } error = usb_add_hcd(hcd, hcd_irq, 0); if (error)