benmccrea commented on a change in pull request #2392:
URL: https://github.com/apache/mynewt-core/pull/2392#discussion_r508832743
##########
File path: hw/mcu/dialog/da1469x/src/da1469x_dma.c
##########
@@ -116,17 +122,19 @@ da1469x_dma_init(void)
struct da1469x_dma_regs *
da1469x_dma_acquire_single(int cidx)
{
- struct da1469x_dma_regs *chan;
+ struct da1469x_dma_regs *chan = NULL;
+ int sr;
assert(cidx < MCU_DMA_CHAN_MAX);
+ OS_ENTER_CRITICAL(sr);
if (cidx < 0) {
cidx = find_free_single();
if (cidx < 0) {
- return NULL;
+ goto end_single;
Review comment:
@nkaje I think you want to still return NULL for the two error cases,
`if (cidx < 0)` and `else if (g_da1469x_dma_acquired & (1 << cidx)`
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]