From 3a658ee32c1fbf6a17a86c0fad1cd592d01d411f Mon Sep 17 00:00:00 2001 From: "chao.an" Date: Sat, 27 Feb 2021 13:39:47 +0800 Subject: [PATCH] mm/circbuf: fix compile warning circbuf/circbuf.c:133:14: warning: 'len' may be used uninitialized in this function [-Wmaybe-uninitialized] 133 | circ->head = len; | ~~~~~~~~~~~^~~~~ circbuf/circbuf.c:106:10: note: 'len' was declared here 106 | size_t len; | ^~~ Change-Id: I60e42b88e98838f5654d84b70f109a4df5a7ff26 Signed-off-by: chao.an --- mm/circbuf/circbuf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/circbuf/circbuf.c b/mm/circbuf/circbuf.c index c4d16e90309..0912e524e71 100644 --- a/mm/circbuf/circbuf.c +++ b/mm/circbuf/circbuf.c @@ -103,7 +103,7 @@ int circbuf_init(FAR struct circbuf_s *circ, FAR void *base, size_t bytes) int circbuf_resize(FAR struct circbuf_s *circ, size_t bytes) { FAR void *tmp = NULL; - size_t len; + size_t len = 0; DEBUGASSERT(circ); DEBUGASSERT(!circ->external);