]> git.baikalelectronics.ru Git - kernel.git/commit
ubifs: Fix uninitialized variable in search_dh_cookie()
authorGeert Uytterhoeven <geert@linux-m68k.org>
Sun, 17 Sep 2017 08:32:20 +0000 (10:32 +0200)
committerRichard Weinberger <richard@nod.at>
Wed, 17 Jan 2018 18:28:53 +0000 (19:28 +0100)
commit9822b14efa9c51be15fa98d769c59dbea234ff19
tree88a8b224272d08b87ad8223d9c2eab97411140c0
parenta06e10a64a9944ccb1759c91d2f33ba3c3e90180
ubifs: Fix uninitialized variable in search_dh_cookie()

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.

Fixes: c69bbff73011 ("ubifs: Fix unlink code wrt. double hash lookups")
Reported-by: Hyunchul Lee <hyc.lee@gmail.com>
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Richard Weinberger <richard@nod.at>
fs/ubifs/tnc.c