Message ID | YmwjUcTKyQNrrn2g@kili (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | spi: mtk-snfi: preserve dma_mapping_error() error codes | expand |
Hi! On Sat, Apr 30, 2022 at 1:42 AM Dan Carpenter <dan.carpenter@oracle.com> wrote: > > Return -ENOMEM of there is a dma mapping error. Do not return success. > > Fixes: 764f1b748164 ("spi: add driver for MTK SPI NAND Flash Interface") > Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Oops. Thanks for fixing that. Reviewed-by: Chuanhong Guo <gch981213@gmail.com> -- Regards, Chuanhong Guo
On Fri, 29 Apr 2022 20:41:37 +0300, Dan Carpenter wrote: > Return -ENOMEM of there is a dma mapping error. Do not return success. > > Applied to https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-next Thanks! [1/1] spi: mtk-snfi: preserve dma_mapping_error() error codes commit: 73c1a5153ec8c53100b13bccafbb29cd502ee086 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
diff --git a/drivers/spi/spi-mtk-snfi.c b/drivers/spi/spi-mtk-snfi.c index 2c556e304673..d66bf9762557 100644 --- a/drivers/spi/spi-mtk-snfi.c +++ b/drivers/spi/spi-mtk-snfi.c @@ -903,7 +903,8 @@ static int mtk_snand_read_page_cache(struct mtk_snand *snf, nfi_write32(snf, NFI_CON, (snf->nfi_cfg.nsectors << CON_SEC_NUM_S)); buf_dma = dma_map_single(snf->dev, buf, dma_len, DMA_FROM_DEVICE); - if (dma_mapping_error(snf->dev, buf_dma)) { + ret = dma_mapping_error(snf->dev, buf_dma); + if (ret) { dev_err(snf->dev, "DMA mapping failed.\n"); goto cleanup; } @@ -1092,7 +1093,8 @@ static int mtk_snand_write_page_cache(struct mtk_snand *snf, nfi_write32(snf, NFI_CON, (snf->nfi_cfg.nsectors << CON_SEC_NUM_S)); buf_dma = dma_map_single(snf->dev, snf->buf, dma_len, DMA_TO_DEVICE); - if (dma_mapping_error(snf->dev, buf_dma)) { + ret = dma_mapping_error(snf->dev, buf_dma); + if (ret) { dev_err(snf->dev, "DMA mapping failed.\n"); goto cleanup; }
Return -ENOMEM of there is a dma mapping error. Do not return success. Fixes: 764f1b748164 ("spi: add driver for MTK SPI NAND Flash Interface") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> --- drivers/spi/spi-mtk-snfi.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)