From mboxrd@z Thu Jan 1 00:00:00 1970 From: Chee, Tien Fong Date: Wed, 30 Aug 2017 05:01:39 +0000 Subject: [U-Boot] [PATCH] libfdt: Initialize the stack variable In-Reply-To: <20170825010434.GK17193@bill-the-cat> References: <1503554037-8020-1-git-send-email-tien.fong.chee@intel.com> <20170825010434.GK17193@bill-the-cat> Message-ID: <1504069299.7727.2.camel@intel.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit To: u-boot@lists.denx.de On Kha, 2017-08-24 at 21:04 -0400, Tom Rini wrote: > On Thu, Aug 24, 2017 at 01:53:57PM +0800, tien.fong.chee at intel.com > wrote: > > > > > From: Tien Fong Chee > > > > Report Coverity log: > > The code uses a variable that has not > > been initialized, leading to unpredictable > > or unintended results. > > > > Signed-off-by: Tien Fong Chee > > --- > >  lib/libfdt/fdt_wip.c |    2 +- > >  1 files changed, 1 insertions(+), 1 deletions(-) > > > > diff --git a/lib/libfdt/fdt_wip.c b/lib/libfdt/fdt_wip.c > > index 45fb964..01adad0 100644 > > --- a/lib/libfdt/fdt_wip.c > > +++ b/lib/libfdt/fdt_wip.c > > @@ -115,7 +115,7 @@ int fdt_find_regions(const void *fdt, char * > > const inc[], int inc_count, > >        struct fdt_region region[], int max_regions, > >        char *path, int path_len, int add_string_tab) > >  { > > - int stack[FDT_MAX_DEPTH]; > > + int stack[FDT_MAX_DEPTH] = { 0 }; > >   char *end; > >   int nextoffset = 0; > >   uint32_t tag; > Since this comes from libfdt, have you checked there as well?  And in > general, we use a Reported-by: Coverity (CID: xxxx) for issues.  BTW, > if > you would like access to the community version of Coverity, please > sign > up at https://scan.coverity.com/projects/das-u-boot?tab=overview > thanks! > Okay, i can add myself to Das U-boot coverity project finally. This warning is reported by CID: 60519. I will send out another patch with Reported-by in commit messages. Thanks.