[PATCH] mtd: rawnand: tegra: drain the IRQ before disabling the clock

sashiko-bot at kernel.org sashiko-bot at kernel.org
Mon Nov 9 11:59:08 PST 2026


Thank you for your contribution! Sashiko AI review found no new issues
in this patch, but noticed 1 related pre-existing issue it does not
introduce:
- [Medium] mtd: rawnand: tegra: device_node reference leak in
  tegra_nand_chips_init() [1]
--

commit 365a7f4452b91b6f2d3ef6a05d0bebfa1d8aca1e
Author: James Hilliard <james.hilliard1 at gmail.com>

mtd: rawnand: tegra: drain the IRQ before disabling the clock

This commit masks controller interrupts and frees the managed IRQ before
suspending the device on driver removal and probe failure.

> diff --git a/drivers/mtd/nand/raw/tegra_nand.c b/drivers/mtd/nand/raw/tegra_nand.c
> index 7f9eb5f042a7e..1104d75b6cbe6 100644
> --- a/drivers/mtd/nand/raw/tegra_nand.c
> +++ b/drivers/mtd/nand/raw/tegra_nand.c
> @@ -1212,10 +1212,13 @@ static int tegra_nand_probe(struct platform_device *pdev)
>  
>  	err = tegra_nand_chips_init(ctrl->dev, ctrl);
>  	if (err)
> -		goto err_put_pm;
> +		goto err_free_irq;

[Severity: Medium]
This problem wasn't introduced by this patch, but does
tegra_nand_chips_init() leak the np_nand device_node reference [1]?
It acquires the child node with of_get_next_child(np, NULL) and never calls
of_node_put() on either its error paths or normal return, leaking a
reference on every probe attempt.

[1] https://sashiko.dev/#/bug/linux-3f05aa6b-f889-4376-97fb-0f7f06b4e683

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261108-submit-tegra-nand-irq-teardown-v1-v1-1-2c570ad4a22c@gmail.com?part=1



More information about the linux-mtd mailing list