dmaengine: at_xdma: handle errors of at_xdmac_alloc_desc() correctly
authorMichael Walle <michael@walle.cc>
Thu, 26 May 2022 13:51:11 +0000 (15:51 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 12 Jul 2022 14:35:18 +0000 (16:35 +0200)
commite08ccbaa5fb3f2abed9290380f86332d64720b60
tree8112dd6af33567bca720e9535c806e1ecf364aaa
parentc787908bee3fd1300be61822dd4ccc96e9bc397b
dmaengine: at_xdma: handle errors of at_xdmac_alloc_desc() correctly

commit 3770d92bd5237d686e49da7b2fb86f53ee6ed259 upstream.

It seems that it is valid to have less than the requested number of
descriptors. But what is not valid and leads to subsequent errors is to
have zero descriptors. In that case, abort the probing.

Fixes: e1f7c9eee707 ("dmaengine: at_xdmac: creation of the atmel eXtended DMA Controller driver")
Signed-off-by: Michael Walle <michael@walle.cc>
Link: https://lore.kernel.org/r/20220526135111.1470926-1-michael@walle.cc
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/dma/at_xdmac.c