lkml.org 
[lkml]   [2021]   [May]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] btrfs: initialize return variable
On Fri, Apr 30, 2021 at 11:06:55AM -0700, trix@redhat.com wrote:
> From: Tom Rix <trix@redhat.com>
>
> Static analysis reports this problem
> free-space-cache.c:3965:2: warning: Undefined or garbage value returned
> return ret;
> ^~~~~~~~~~
>
> ret is set in the node handling loop.
> Treat doing nothing as a success and initialize ret to 0.

Right, though it's unlikely the loop won't run at least once, having the
ret initialized is safe. Patch added to misc-next, thanks.

\
 
 \ /
  Last update: 2021-05-03 15:55    [W:0.030 / U:0.200 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site