* [PATCH v4] spi: ppc4xx: handle irq_of_parse_and_map() errors
@ 2024-07-24 8:40 Ma Ke
2024-07-24 11:35 ` Markus Elfring
2024-07-29 15:40 ` [PATCH v4] " Mark Brown
0 siblings, 2 replies; 5+ messages in thread
From: Ma Ke @ 2024-07-24 8:40 UTC (permalink / raw)
To: broonie, jwboyer, weo, sfalco, sr, dbrownell
Cc: linux-spi, linux-kernel, Ma Ke
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.
Fixes: 44dab88e7cc9 ("spi: add spi_ppc4xx driver")
Signed-off-by: Ma Ke <make24@iscas.ac.cn>
---
Changes in v4:
- fixed a typo in v3. Sorry for the error in the patch v3.
Changes in v3:
- removed Cc stable line as suggestions.
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] 5+ messages in thread* Re: [PATCH v4] spi: ppc4xx: handle irq_of_parse_and_map() errors
2024-07-24 8:40 [PATCH v4] spi: ppc4xx: handle irq_of_parse_and_map() errors Ma Ke
@ 2024-07-24 11:35 ` Markus Elfring
2024-07-24 11:39 ` Mark Brown
2024-07-29 15:40 ` [PATCH v4] " Mark Brown
1 sibling, 1 reply; 5+ messages in thread
From: Markus Elfring @ 2024-07-24 11:35 UTC (permalink / raw)
To: make24, linux-spi
Cc: LKML, Andrew Morton, Mark Brown, Stefan Roese, Wolfgang Ocker
…
> Signed-off-by: Ma Ke <make24@iscas.ac.cn>
Does anybody care more for the applicability of such information?
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?h=v6.10#n398
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/researcher-guidelines.rst?h=v6.10#n5
> ---
> Changes in v4:
> - fixed a typo in v3. Sorry for the error in the patch v3.
…
https://lore.kernel.org/linux-kernel/20240722141822.1052370-1-make24@iscas.ac.cn/
How could the published development mistake happen at all in your research organisation?
Regards,
Markus
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v4] spi: ppc4xx: handle irq_of_parse_and_map() errors
2024-07-24 11:35 ` Markus Elfring
@ 2024-07-24 11:39 ` Mark Brown
2024-07-24 11:55 ` [v4] " Markus Elfring
0 siblings, 1 reply; 5+ messages in thread
From: Mark Brown @ 2024-07-24 11:39 UTC (permalink / raw)
To: Markus Elfring
Cc: make24, linux-spi, LKML, Andrew Morton, Stefan Roese, Wolfgang Ocker
[-- Attachment #1: Type: text/plain, Size: 602 bytes --]
On Wed, Jul 24, 2024 at 01:35:52PM +0200, Markus Elfring wrote:
> …
> > Signed-off-by: Ma Ke <make24@iscas.ac.cn>
>
> Does anybody care more for the applicability of such information?
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?h=v6.10#n398
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/researcher-guidelines.rst?h=v6.10#n5
Feel free to ignore Markus, he has a long history of sending
unhelpful review comments and continues to ignore repeated requests
to stop.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v4] spi: ppc4xx: handle irq_of_parse_and_map() errors
2024-07-24 8:40 [PATCH v4] spi: ppc4xx: handle irq_of_parse_and_map() errors Ma Ke
2024-07-24 11:35 ` Markus Elfring
@ 2024-07-29 15:40 ` Mark Brown
1 sibling, 0 replies; 5+ messages in thread
From: Mark Brown @ 2024-07-29 15:40 UTC (permalink / raw)
To: jwboyer, weo, sfalco, sr, dbrownell, Ma Ke; +Cc: linux-spi, linux-kernel
On Wed, 24 Jul 2024 16:40:47 +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.
>
>
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-next
Thanks!
[1/1] spi: ppc4xx: handle irq_of_parse_and_map() errors
commit: 0f245463b01ea254ae90e1d0389e90b0e7d8dc75
All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying
to this mail.
Thanks,
Mark
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2024-07-29 15:40 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-07-24 8:40 [PATCH v4] spi: ppc4xx: handle irq_of_parse_and_map() errors Ma Ke
2024-07-24 11:35 ` Markus Elfring
2024-07-24 11:39 ` Mark Brown
2024-07-24 11:55 ` [v4] " Markus Elfring
2024-07-29 15:40 ` [PATCH v4] " Mark Brown
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®