Commit 0410e1a4 authored by Chen Ni's avatar Chen Ni Committed by Miquel Raynal
Browse files

mtd: rawnand: cadence: Fix error check for dma_alloc_coherent() in cadence_nand_init()



Fix wrong variable used for error checking after dma_alloc_coherent()
call. The function checks cdns_ctrl->dma_cdma_desc instead of
cdns_ctrl->cdma_desc, which could lead to incorrect error handling.

Fixes: ec4ba01e ("mtd: rawnand: Add new Cadence NAND driver to MTD subsystem")
Cc: stable@vger.kernel.org
Signed-off-by: default avatarChen Ni <nichen@iscas.ac.cn>
Reviewed-by: default avatarAlok Tiwari <alok.a.tiwari@oracle.com>
Signed-off-by: default avatarMiquel Raynal <miquel.raynal@bootlin.com>
parent 8e2f8020
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -3133,7 +3133,7 @@ static int cadence_nand_init(struct cdns_nand_ctrl *cdns_ctrl)
						  sizeof(*cdns_ctrl->cdma_desc),
						  &cdns_ctrl->dma_cdma_desc,
						  GFP_KERNEL);
	if (!cdns_ctrl->dma_cdma_desc)
	if (!cdns_ctrl->cdma_desc)
		return -ENOMEM;

	cdns_ctrl->buf_size = SZ_16K;