linux/drivers/dma/dw-edma
Christophe JAILLET 1ffc6f359f dmaengine: dw-edma: Fix return value check for dma_set_mask_and_coherent()
The commit in the Fixes: tag has changed the logic of the code and now it
is likely that the probe will return an early success (0), even if not
completely executed.

This should lead to a crash or similar issue later on when the code
accesses to some never allocated resources.

Change the '!err' into a 'err' when checking if
'dma_set_mask_and_coherent()' has failed or not.

While at it, simplify the code and remove the "can't success code" related
to 32 DMA mask.
As stated in [1], 'dma_set_mask_and_coherent(DMA_BIT_MASK(64))' can't fail
if 'dev->dma_mask' is non-NULL. And if it is NULL, it would fail for the
same reason when tried with DMA_BIT_MASK(32).

[1]: https://lkml.org/lkml/2021/6/7/398

Fixes: ecb8c88bd3 ("dmaengine: dw-edma-pcie: switch from 'pci_' to 'dma_' API")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://lore.kernel.org/r/935fbb40ae930c5fe87482a41dcb73abf2257973.1636492127.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Vinod Koul <vkoul@kernel.org>
2021-11-22 12:14:12 +05:30
..
dw-edma-core.c dmaengine: dw-edma: Remove an unused variable 2021-10-18 12:11:08 +05:30
dw-edma-core.h dmaengine: dw-edma: Move struct dentry variable from static definition into dw_edma struct 2021-03-16 22:58:53 +05:30
dw-edma-pcie.c dmaengine: dw-edma: Fix return value check for dma_set_mask_and_coherent() 2021-11-22 12:14:12 +05:30
dw-edma-v0-core.c dmaengine: dw-edma: Move struct dentry variable from static definition into dw_edma struct 2021-03-16 22:58:53 +05:30
dw-edma-v0-core.h dmaengine: dw-edma: Move struct dentry variable from static definition into dw_edma struct 2021-03-16 22:58:53 +05:30
dw-edma-v0-debugfs.c dmaengine: dw-edma: Move struct dentry variable from static definition into dw_edma struct 2021-03-16 22:58:53 +05:30
dw-edma-v0-debugfs.h dmaengine: dw-edma: Move struct dentry variable from static definition into dw_edma struct 2021-03-16 22:58:53 +05:30
dw-edma-v0-regs.h dmaengine: dw-edma: Fix comments offset characters' alignment 2021-03-16 22:58:52 +05:30
Kconfig dmaengine: dw-edma: Fix build error without CONFIG_PCI_MSI 2019-06-12 10:22:02 +05:30
Makefile dmaengine: Add Synopsys eDMA IP PCIe glue-logic 2019-06-10 13:10:39 +05:30