All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sergey Shtylyov <s.shtylyov@omp.ru>
To: <linux-usb@vger.kernel.org>,
	Alan Stern <stern@rowland.harvard.edu>,
	"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>
Subject: [PATCH 14/22] usb: host: ohci-pxa27x: deny IRQ0
Date: Mon, 18 Oct 2021 21:39:22 +0300	[thread overview]
Message-ID: <20211018183930.8448-15-s.shtylyov@omp.ru> (raw)
In-Reply-To: <20211018183930.8448-1-s.shtylyov@omp.ru>

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: 84bab7393b0d ("[ARM] ohci-pxa27x: use platform_get_{irq,resource} for the resource")
Signed-off-by: Sergey Shtylyov <s.shtylyov@omp.ru>
---
 drivers/usb/host/ohci-pxa27x.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/usb/host/ohci-pxa27x.c b/drivers/usb/host/ohci-pxa27x.c
index 54aa5c77e549..336437277fd0 100644
--- a/drivers/usb/host/ohci-pxa27x.c
+++ b/drivers/usb/host/ohci-pxa27x.c
@@ -443,6 +443,8 @@ static int ohci_hcd_pxa27x_probe(struct platform_device *pdev)
 		pr_err("no resource of IORESOURCE_IRQ");
 		return irq;
 	}
+	if (!irq)
+		return -EINVAL;
 
 	usb_clk = devm_clk_get(&pdev->dev, NULL);
 	if (IS_ERR(usb_clk))
-- 
2.26.3


  parent reply	other threads:[~2021-10-18 18:39 UTC|newest]

Thread overview: 57+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-18 18:39 [PATCH 00/22] Explicitly deny IRQ0 in the USB host drivers Sergey Shtylyov
2021-10-18 18:39 ` [PATCH 01/22] usb: host: ehci-exynos: deny IRQ0 Sergey Shtylyov
2021-10-18 18:39   ` Sergey Shtylyov
2021-10-18 18:39 ` [PATCH 02/22] usb: host: ehci-mv: " Sergey Shtylyov
2021-10-18 18:39 ` [PATCH 03/22] usb: host: ehci-npcm7xx: " Sergey Shtylyov
2021-10-18 18:39   ` Sergey Shtylyov
2021-10-19  7:11   ` Avi Fishman
2021-10-19  7:11     ` Avi Fishman
2021-10-18 18:39 ` [PATCH 04/22] usb: host: ehci-omap: " Sergey Shtylyov
2021-10-21  6:28   ` kernel test robot
2021-10-21  6:28     ` kernel test robot
2021-10-18 18:39 ` [PATCH 05/22] usb: host: ehci-platform: " Sergey Shtylyov
2021-10-18 18:39   ` Sergey Shtylyov
2021-10-18 18:39 ` [PATCH 06/22] usb: host: ehci-spear: " Sergey Shtylyov
2021-10-18 18:39 ` [PATCH 07/22] usb: host: ehci-st: " Sergey Shtylyov
2021-10-18 18:39   ` Sergey Shtylyov
2021-10-18 18:39 ` [PATCH 08/22] usb: host: ohci-at91: " Sergey Shtylyov
2021-10-18 18:39   ` Sergey Shtylyov
2021-10-18 18:39 ` [PATCH 09/22] usb: host: ohci-da8xx: " Sergey Shtylyov
2021-10-18 18:39 ` [PATCH 10/22] usb: host: ohci-exynos: " Sergey Shtylyov
2021-10-18 18:39   ` Sergey Shtylyov
2021-10-18 18:39 ` [PATCH 11/22] usb: host: ohci-at91: " Sergey Shtylyov
2021-10-18 18:39   ` Sergey Shtylyov
2021-10-19 11:15   ` Alexander Dahl
2021-10-19 11:15     ` Alexander Dahl
2021-10-19 16:51     ` Sergey Shtylyov
2021-10-19 16:51       ` Sergey Shtylyov
2021-10-18 18:39 ` [PATCH 12/22] usb: host: ohci-omap: " Sergey Shtylyov
2021-10-18 18:39 ` [PATCH 13/22] usb: host: ohci-platform: " Sergey Shtylyov
2021-10-18 18:39 ` Sergey Shtylyov [this message]
2021-10-18 18:39 ` [PATCH 15/22] usb: host: ohci-sm501: " Sergey Shtylyov
2021-10-18 18:39 ` [PATCH 16/22] usb: host: ohci-spear: " Sergey Shtylyov
2021-10-18 18:39 ` [PATCH 17/22] usb: host: ohci-st: " Sergey Shtylyov
2021-10-18 18:39   ` Sergey Shtylyov
2021-10-18 18:39 ` [PATCH 18/22] usb: host: ohci-tmio: " Sergey Shtylyov
2021-10-18 18:39 ` [PATCH 19/22] usb: host: xhci-histb: " Sergey Shtylyov
2021-10-18 18:39 ` [PATCH 20/22] usb: host: xhci-mtk: " Sergey Shtylyov
2021-10-18 18:39   ` Sergey Shtylyov
2021-10-18 18:39   ` Sergey Shtylyov
2021-10-20  7:32   ` Chunfeng Yun
2021-10-20  7:32     ` Chunfeng Yun
2021-10-20  7:32     ` Chunfeng Yun
2021-10-18 18:39 ` [PATCH 21/22] usb: host: xhci-plat: " Sergey Shtylyov
2021-10-18 18:39 ` [PATCH 22/22] usb: host: xhci-tegra: " Sergey Shtylyov
2021-10-21  9:09   ` Dmitry Osipenko
2021-10-26 18:24     ` Sergey Shtylyov
2021-10-27 11:13       ` Dmitry Osipenko
2021-10-19  1:35 ` [PATCH 00/22] Explicitly deny IRQ0 in the USB host drivers Alan Stern
2021-10-19  5:41 ` Greg Kroah-Hartman
2021-10-19  7:31   ` Greg Kroah-Hartman
2021-10-19 18:28     ` Sergey Shtylyov
2021-10-19 18:35       ` Alan Stern
2021-10-19 18:46         ` Sergey Shtylyov
2021-10-20 16:06           ` Sergey Shtylyov
2021-10-19 18:18   ` Sergey Shtylyov
2021-10-20 16:16 ` Greg Kroah-Hartman
2021-10-20 18:50   ` Sergey Shtylyov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211018183930.8448-15-s.shtylyov@omp.ru \
    --to=s.shtylyov@omp.ru \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=stern@rowland.harvard.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.