]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
mtd: rawnand: cadence: fix DMA device NULL pointer dereference
authorNiravkumar L Rabara <niravkumarlaxmidas.rabara@altera.com>
Thu, 23 Oct 2025 03:32:01 +0000 (11:32 +0800)
committerMiquel Raynal <miquel.raynal@bootlin.com>
Thu, 23 Oct 2025 07:03:13 +0000 (09:03 +0200)
commit5c56bf214af85ca042bf97f8584aab2151035840
treed93ac2ed98bac869f006131d01b088c60c6240b8
parent9631350885929819d4e46c6521df35960b472ef3
mtd: rawnand: cadence: fix DMA device NULL pointer dereference

The DMA device pointer `dma_dev` was being dereferenced before ensuring
that `cdns_ctrl->dmac` is properly initialized.

Move the assignment of `dma_dev` after successfully acquiring the DMA
channel to ensure the pointer is valid before use.

Fixes: d76d22b5096c ("mtd: rawnand: cadence: use dma_map_resource for sdma address")
Cc: stable@vger.kernel.org
Signed-off-by: Niravkumar L Rabara <niravkumarlaxmidas.rabara@altera.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
drivers/mtd/nand/raw/cadence-nand-controller.c