This is an automated email from the ASF dual-hosted git repository.

aguettouche pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git


The following commit(s) were added to refs/heads/master by this push:
     new f8832f7  mpfs: emmcsd: fix uninitialized value
f8832f7 is described below

commit f8832f7d86ddd0c77f40cc7523d096fcafbc4e60
Author: Eero Nurkkala <eero.nurkk...@offcode.fi>
AuthorDate: Fri Nov 5 11:48:29 2021 +0200

    mpfs: emmcsd: fix uninitialized value
    
    cppcheck reports the following:
    
    arch/risc-v/src/mpfs/mpfs_emmcsd.c:2375:22: error: Uninitialized variable: 
waitbits [uninitvar]
      while (!(status & (waitbits | MPFS_EMMCSD_SRS12_EINT))
    
    The finding is positive and this patch initializes it to
    zero properly.
    
    Signed-off-by: Eero Nurkkala <eero.nurkk...@offcode.fi>
---
 arch/risc-v/src/mpfs/mpfs_emmcsd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/risc-v/src/mpfs/mpfs_emmcsd.c 
b/arch/risc-v/src/mpfs/mpfs_emmcsd.c
index bf03fbb..a4455a8 100755
--- a/arch/risc-v/src/mpfs/mpfs_emmcsd.c
+++ b/arch/risc-v/src/mpfs/mpfs_emmcsd.c
@@ -2332,7 +2332,7 @@ static int mpfs_waitresponse(struct sdio_dev_s *dev, 
uint32_t cmd)
   struct mpfs_dev_s *priv = (struct mpfs_dev_s *)dev;
   uint32_t status;
   int32_t timeout;
-  uint32_t waitbits;
+  uint32_t waitbits = 0;
 
   mcinfo("cmd: %08" PRIx32 "\n", cmd);
 

Reply via email to