* [PATCH v2] spi: ppc4xx: handle irq_of_parse_and_map() errors
@ 2024-07-22 12:35 Ma Ke
2024-07-22 13:40 ` Mark Brown
0 siblings, 1 reply; 3+ messages in thread
From: Ma Ke @ 2024-07-22 12:35 UTC (permalink / raw)
To: broonie, sfalco, sr, dbrownell, jwboyer, akpm
Cc: linux-spi, linux-kernel, Ma Ke, stable
Zero and negative number is not a valid IRQ for in-kernel code and the
irq_of_parse_and_map() function returns zero on error. So this check for
valid IRQs should only accept values > 0.
Cc: stable@vger.kernel.org
Fixes: 44dab88e7cc9 ("spi: add spi_ppc4xx driver")
Signed-off-by: Ma Ke <make24@iscas.ac.cn>
---
Changes in v2:
- added Cc stable line;
- added Fixes line.
---
drivers/spi/spi-ppc4xx.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/spi/spi-ppc4xx.c b/drivers/spi/spi-ppc4xx.c
index 942c3117ab3a..01fdecbf132d 100644
--- a/drivers/spi/spi-ppc4xx.c
+++ b/drivers/spi/spi-ppc4xx.c
@@ -413,6 +413,9 @@ static int spi_ppc4xx_of_probe(struct platform_device *op)
/* Request IRQ */
hw->irqnum = irq_of_parse_and_map(np, 0);
+ if (hw->irqnum <= 0)
+ goto free_host;
+
ret = request_irq(hw->irqnum, spi_ppc4xx_int,
0, "spi_ppc4xx_of", (void *)hw);
if (ret) {
--
2.25.1
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH v2] spi: ppc4xx: handle irq_of_parse_and_map() errors
2024-07-22 12:35 [PATCH v2] spi: ppc4xx: handle irq_of_parse_and_map() errors Ma Ke
@ 2024-07-22 13:40 ` Mark Brown
2024-07-24 8:22 ` Markus Elfring
0 siblings, 1 reply; 3+ messages in thread
From: Mark Brown @ 2024-07-22 13:40 UTC (permalink / raw)
To: Ma Ke
Cc: sfalco, sr, dbrownell, jwboyer, akpm, linux-spi, linux-kernel, stable
[-- Attachment #1: Type: text/plain, Size: 514 bytes --]
On Mon, Jul 22, 2024 at 08:35:19PM +0800, Ma Ke wrote:
> Zero and negative number is not a valid IRQ for in-kernel code and the
> irq_of_parse_and_map() function returns zero on error. So this check for
> valid IRQs should only accept values > 0.
>
> Cc: stable@vger.kernel.org
> Fixes: 44dab88e7cc9 ("spi: add spi_ppc4xx driver")
> Signed-off-by: Ma Ke <make24@iscas.ac.cn>
> ---
> Changes in v2:
> - added Cc stable line;
> - added Fixes line.
The Cc stable seems clearly disproportionate here.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH v2] spi: ppc4xx: handle irq_of_parse_and_map() errors
2024-07-22 13:40 ` Mark Brown
@ 2024-07-24 8:22 ` Markus Elfring
0 siblings, 0 replies; 3+ messages in thread
From: Markus Elfring @ 2024-07-24 8:22 UTC (permalink / raw)
To: Mark Brown, make24, linux-spi; +Cc: stable, LKML, Andrew Morton, Stefan Roese
> > Zero and negative number is not a valid IRQ for in-kernel code and the
> > irq_of_parse_and_map() function returns zero on error. So this check for
> > valid IRQs should only accept values > 0.
> >
> > Cc: stable@vger.kernel.org
> > Fixes: 44dab88e7cc9 ("spi: add spi_ppc4xx driver")
> > Signed-off-by: Ma Ke <make24@iscas.ac.cn>
> > ---
> > Changes in v2:
> > - added Cc stable line;
> > - added Fixes line.
>
> The Cc stable seems clearly disproportionate here.
I wonder a bit about such a feedback (according to a commit from 2009-09-23).
Greg Kroah-Hartman configured a patch email bot in other ways.
Another example:
Re: [PATCH] usb: typec: ucsi: Fix NULL pointer dereference in ucsi_displayport_vdm()
https://lore.kernel.org/linux-usb/2024072333-popcorn-detached-f399@gregkh/
Regards,
Markus
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-07-24 8:23 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-07-22 12:35 [PATCH v2] spi: ppc4xx: handle irq_of_parse_and_map() errors Ma Ke
2024-07-22 13:40 ` Mark Brown
2024-07-24 8:22 ` Markus Elfring
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®