All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sergey Shtylyov <s.shtylyov@omp.ru>
To: <linux-usb@vger.kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Felipe Balbi <balbi@kernel.org>
Cc: Al Cooper <alcooperx@gmail.com>,
	Florian Fainelli <f.fainelli@gmail.com>,
	<bcm-kernel-feedback-list@broadcom.com>,
	<linux-arm-kernel@lists.infradead.org>
Subject: [PATCH v2 6/9] usb: misc: brcmstb-usb-pinmap: add IRQ check
Date: Mon, 9 Aug 2021 23:45:15 +0300	[thread overview]
Message-ID: <806d0b1a-365b-93d9-3fc1-922105ca5e61@omp.ru> (raw)
In-Reply-To: <47bacc02-4e34-3208-779c-7072a6261782@omp.ru>

The driver neglects to check the result of platform_get_irq()'s call and
blithely passes the negative error codes to devm_request_irq() (which takes
*unsigned* IRQ #), causing it to fail with -EINVAL, overriding an original
error code.  Stop calling devm_request_irq() with the invalid IRQ #s.

Fixes: 517c4c44b323 ("usb: Add driver to allow any GPIO to be used for 7211 USB signals")
Signed-off-by: Sergey Shtylyov <s.shtylyov@omp.ru>

---
 drivers/usb/misc/brcmstb-usb-pinmap.c |    2 ++
 1 file changed, 2 insertions(+)

Index: usb/drivers/usb/misc/brcmstb-usb-pinmap.c
===================================================================
--- usb.orig/drivers/usb/misc/brcmstb-usb-pinmap.c
+++ usb/drivers/usb/misc/brcmstb-usb-pinmap.c
@@ -293,6 +293,8 @@ static int __init brcmstb_usb_pinmap_pro
 
 		/* Enable interrupt for out pins */
 		irq = platform_get_irq(pdev, 0);
+		if (irq < 0)
+			return irq;
 		err = devm_request_irq(&pdev->dev, irq,
 				       brcmstb_usb_pinmap_ovr_isr,
 				       IRQF_TRIGGER_RISING,

WARNING: multiple messages have this Message-ID (diff)
From: Sergey Shtylyov <s.shtylyov@omp.ru>
To: <linux-usb@vger.kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Felipe Balbi <balbi@kernel.org>
Cc: Al Cooper <alcooperx@gmail.com>,
	Florian Fainelli <f.fainelli@gmail.com>,
	 <bcm-kernel-feedback-list@broadcom.com>,
	<linux-arm-kernel@lists.infradead.org>
Subject: [PATCH v2 6/9] usb: misc: brcmstb-usb-pinmap: add IRQ check
Date: Mon, 9 Aug 2021 23:45:15 +0300	[thread overview]
Message-ID: <806d0b1a-365b-93d9-3fc1-922105ca5e61@omp.ru> (raw)
In-Reply-To: <47bacc02-4e34-3208-779c-7072a6261782@omp.ru>

The driver neglects to check the result of platform_get_irq()'s call and
blithely passes the negative error codes to devm_request_irq() (which takes
*unsigned* IRQ #), causing it to fail with -EINVAL, overriding an original
error code.  Stop calling devm_request_irq() with the invalid IRQ #s.

Fixes: 517c4c44b323 ("usb: Add driver to allow any GPIO to be used for 7211 USB signals")
Signed-off-by: Sergey Shtylyov <s.shtylyov@omp.ru>

---
 drivers/usb/misc/brcmstb-usb-pinmap.c |    2 ++
 1 file changed, 2 insertions(+)

Index: usb/drivers/usb/misc/brcmstb-usb-pinmap.c
===================================================================
--- usb.orig/drivers/usb/misc/brcmstb-usb-pinmap.c
+++ usb/drivers/usb/misc/brcmstb-usb-pinmap.c
@@ -293,6 +293,8 @@ static int __init brcmstb_usb_pinmap_pro
 
 		/* Enable interrupt for out pins */
 		irq = platform_get_irq(pdev, 0);
+		if (irq < 0)
+			return irq;
 		err = devm_request_irq(&pdev->dev, irq,
 				       brcmstb_usb_pinmap_ovr_isr,
 				       IRQF_TRIGGER_RISING,

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  parent reply	other threads:[~2021-08-09 20:45 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-09 20:16 [PATCH v2 0/9] Stop calling request_irq(), etc. with invalid IRQs in the USB drivers Sergey Shtylyov
2021-08-09 20:21 ` [PATCH v2 1/9] usb: dwc3: meson-g12a: add IRQ check Sergey Shtylyov
2021-08-09 20:21   ` Sergey Shtylyov
2021-08-09 20:21   ` Sergey Shtylyov
2021-08-09 20:23 ` [PATCH v2 2/9] usb: dwc3: qcom: " Sergey Shtylyov
2021-08-09 20:27 ` [PATCH v2 3/6] usb: gadget: udc: at91: " Sergey Shtylyov
2021-08-09 20:27   ` Sergey Shtylyov
2021-08-09 20:35 ` [PATCH v2 4/9] usb: gadget: udc: s3c2410: " Sergey Shtylyov
2021-08-09 20:35   ` Sergey Shtylyov
2021-08-10  6:53   ` Krzysztof Kozlowski
2021-08-10  6:53     ` Krzysztof Kozlowski
2021-08-12  5:40   ` Felipe Balbi
2021-08-12  5:40     ` Felipe Balbi
2021-08-09 20:41 ` [PATCH v2 5/9] usb: host: ohci-tmio: " Sergey Shtylyov
2021-08-09 20:54   ` Alan Stern
2021-08-09 20:45 ` Sergey Shtylyov [this message]
2021-08-09 20:45   ` [PATCH v2 6/9] usb: misc: brcmstb-usb-pinmap: " Sergey Shtylyov
2021-08-10  9:51   ` Florian Fainelli
2021-08-10  9:51     ` Florian Fainelli
2021-08-09 20:50 ` [PATCH v2 7/9] usb: phy: fsl-usb: " Sergey Shtylyov
2021-08-09 20:50   ` Sergey Shtylyov
2021-08-12  5:38   ` Felipe Balbi
2021-08-12  5:38     ` Felipe Balbi
2021-08-09 20:52 ` [PATCH v2 8/9] usb: phy: tahvo: " Sergey Shtylyov
2021-08-12  5:39   ` Felipe Balbi
2021-08-13  7:02   ` Greg Kroah-Hartman
2021-08-13 10:33     ` Sergey Shtylyov
2021-08-09 20:53 ` [PATCH v2 9/9] usb: phy: twl6030: add IRQ checks Sergey Shtylyov
2021-08-12  5:39   ` Felipe Balbi

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=806d0b1a-365b-93d9-3fc1-922105ca5e61@omp.ru \
    --to=s.shtylyov@omp.ru \
    --cc=alcooperx@gmail.com \
    --cc=balbi@kernel.org \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=f.fainelli@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-usb@vger.kernel.org \
    /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.