Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Coverity CID :205653]Control flow issues in /drivers/dma/dma_stm32_v1.c #20492

Closed
aasthagr opened this issue Nov 8, 2019 · 4 comments
Closed
Assignees
Labels
area: DMA Direct Memory Access area: Drivers bug The issue is a bug, or the PR is fixing a bug Coverity A Coverity detected issue or its fix priority: low Low impact/importance bug

Comments

@aasthagr
Copy link
Collaborator

aasthagr commented Nov 8, 2019

Static code scan issues seen in File: /drivers/dma/dma_stm32_v1.c
Category: Control flow issues
Function: stm32_dma_check_fifo_mburst
Component: Drivers
CID: 205653
Please fix or provide comments to square it off in coverity in the link: https://scan9.coverity.com/reports.htm#v32951/p12996

@aasthagr aasthagr added area: Drivers bug The issue is a bug, or the PR is fixing a bug Coverity A Coverity detected issue or its fix labels Nov 8, 2019
@aescolar
Copy link
Member

749d2d2

287bool stm32_dma_check_fifo_mburst(LL_DMA_InitTypeDef *DMAx)
288{
289        u32_t msize = DMAx->MemoryOrM2MDstDataSize;
290        u32_t fifo_level = DMAx->FIFOThreshold;
291        u32_t mburst = DMAx->MemBurst;
292
293        switch (msize) {
   	
CID 205653 (#1 of 1): Missing break in switch (MISSING_BREAK)
unterminated_case: The case for value 0U is not terminated by a 'break' statement.
294        case LL_DMA_MDATAALIGN_BYTE:
295                switch (mburst) {
296                case LL_DMA_MBURST_INC4:
297                        return true;
298                case LL_DMA_MBURST_INC8:
299                        if (fifo_level == LL_DMA_FIFOTHRESHOLD_1_2 ||
300                            fifo_level == LL_DMA_FIFOTHRESHOLD_FULL) {
301                                return true;
302                        } else {
303                                return false;
304                        }
305                case LL_DMA_MBURST_INC16:
306                        if (fifo_level == LL_DMA_FIFOTHRESHOLD_FULL) {
307                                return true;
308                        } else {
309                                return false;
310                        }
311                }
   	CID 205644: Missing break in switch (MISSING_BREAK) [select issue]
   	fallthrough: The above case falls through to this one.
312        case LL_DMA_MDATAALIGN_HALFWORD:
313                switch (mburst) {
314                case LL_DMA_MBURST_INC4:
315                        if (fifo_level == LL_DMA_FIFOTHRESHOLD_1_2 ||
316                            fifo_level == LL_DMA_FIFOTHRESHOLD_FULL) {
317                                return true;

@aescolar aescolar added the area: DMA Direct Memory Access label Nov 11, 2019
@galak galak added the priority: medium Medium impact/importance bug label Nov 11, 2019
@cybertale
Copy link
Collaborator

This is explained in #20491 .

@dleach02
Copy link
Member

per @cybertale description, this is a false positive and is by design.

@dleach02 dleach02 added priority: low Low impact/importance bug and removed priority: medium Medium impact/importance bug labels Nov 26, 2019
@nashif
Copy link
Member

nashif commented Mar 11, 2020

marked as fp, clsoing

@nashif nashif closed this as completed Mar 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: DMA Direct Memory Access area: Drivers bug The issue is a bug, or the PR is fixing a bug Coverity A Coverity detected issue or its fix priority: low Low impact/importance bug
Projects
None yet
Development

No branches or pull requests

6 participants