[U-Boot] [PATCH 2/4] fs: btrfs: Fix usage of uninitialized variables

Marek Behún marek.behun at nic.cz
Fri Oct 6 14:28:34 UTC 2017


On Fri, 6 Oct 2017 06:54:34 -0700
"J. William Campbell" <jwilliamcampbell at comcast.net> wrote:

> Hi Marek,
>          If the searched key is not found, isn't it an error to use
> the res value AT ALL? Setting it to 0 may cover up the warning, but
> the function shouldn't actually use it for anything. If it does, it
> is modifying an element that doesn't match the search key.

Hi Bill,

the res variable is just an indicator if an error occured.
In these functions if no key is found, it is not an error (for example
if no key is found in btrfs_readdir, it just means the directory is
empty, which is not an error).

Marek

> 
> Best Regards,
> Bill Campbell


More information about the U-Boot mailing list