From: Alan Stern <stern@rowland.harvard.edu>
To: Sergey Shtylyov <s.shtylyov@omp.ru>
Cc: linux-usb@vger.kernel.org,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Felipe Balbi <balbi@kernel.org>
Subject: Re: [PATCH v3 1/2] usb: host: ohci-tmio: add IRQ check
Date: Fri, 13 Aug 2021 21:45:47 -0400 [thread overview]
Message-ID: <20210814014547.GB56183@rowland.harvard.edu> (raw)
In-Reply-To: <402e1a45-a0a4-0e08-566a-7ca1331506b1@omp.ru>
On Fri, Aug 13, 2021 at 11:30:18PM +0300, Sergey Shtylyov wrote:
> The driver neglects to check the result of platform_get_irq()'s call and
> blithely passes the negative error codes to usb_add_hcd() (which takes
> *unsigned* IRQ #), causing request_irq() that it calls to fail with
> -EINVAL, overriding an original error code. Stop calling usb_add_hcd()
> with the invalid IRQ #s.
>
> Fixes: 78c73414f4f6 ("USB: ohci: add support for tmio-ohci cell")
> Signed-off-by: Sergey Shtylyov <s.shtylyov@omp.ru>
>
> ---
Acked-by: Alan Stern <stern@rowland.harvard.edu>
> Changes in version 3:
> - move the IRQ check higher in ohci_hcd_tmio_drv_probe(), to be closer to
> platfrom_get_irq()'s call.
>
> drivers/usb/host/ohci-tmio.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> Index: usb/drivers/usb/host/ohci-tmio.c
> ===================================================================
> --- usb.orig/drivers/usb/host/ohci-tmio.c
> +++ usb/drivers/usb/host/ohci-tmio.c
> @@ -202,6 +202,9 @@ static int ohci_hcd_tmio_drv_probe(struc
> if (!cell)
> return -EINVAL;
>
> + if (irq < 0)
> + return irq;
> +
> hcd = usb_create_hcd(&ohci_tmio_hc_driver, &dev->dev, dev_name(&dev->dev));
> if (!hcd) {
> ret = -ENOMEM;
next prev parent reply other threads:[~2021-08-14 1:45 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-13 20:23 [PATCH v3 0/2] Stop calling request_irq(), etc. with invalid IRQs in the USB drivers` Sergey Shtylyov
2021-08-13 20:30 ` [PATCH v3 1/2] usb: host: ohci-tmio: add IRQ check Sergey Shtylyov
2021-08-14 1:45 ` Alan Stern [this message]
2021-08-13 20:32 ` [PATCH v3 2/2] usb: phy: tahvo: " Sergey Shtylyov
2021-08-14 11:28 ` Felipe Balbi
2021-08-14 6:39 ` [PATCH v3 0/2] Stop calling request_irq(), etc. with invalid IRQs in the USB drivers` Greg Kroah-Hartman
2021-08-14 11:59 ` Sergey Shtylyov
2021-08-14 13:34 ` Greg Kroah-Hartman
2021-08-14 18:16 ` 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=20210814014547.GB56183@rowland.harvard.edu \
--to=stern@rowland.harvard.edu \
--cc=balbi@kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-usb@vger.kernel.org \
--cc=s.shtylyov@omp.ru \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).