lkml.org 
[lkml]   [2017]   [Sep]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH] ubifs: Fix uninitialized variable in search_dh_cookie()
Date
Am Sonntag, 17. September 2017, 10:32:20 CEST schrieb Geert Uytterhoeven:
> fs/ubifs/tnc.c: In function ‘search_dh_cookie’:
> fs/ubifs/tnc.c:1893: warning: ‘err’ is used uninitialized in this function
>
> Indeed, err is always used uninitialized.
>
> According to an original review comment from Hyunchul, acknowledged by
> Richard, err should be initialized to -ENOENT to avoid the first call to
> tnc_next(). But we can achieve the same by reordering the code.
>
> Reported-by: Hyunchul Lee <hyc.lee@gmail.com>
> Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
> ---
> Compile-tested only.
>
> Still needed in v4.14-rc1, so I'm sending out the patch I wrote in July.
> This avoids initializing err at the top, so we don't loose the ability to
> catch future uninitialized use.

Geez. ;-\
Applied for 4.14-rc2.

Thanks,
//richard

\
 
 \ /
  Last update: 2017-09-17 18:54    [W:0.035 / U:1.332 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site