lkml.org 
[lkml]   [2019]   [Jul]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] ceph: fix uninitialized return code
On Mon, Jul 08, 2019 at 03:48:08PM +0200, Arnd Bergmann wrote:
> clang points out a -Wsometimed-uninitized bug in the modified
> ceph_real_mount() function:
>
> fs/ceph/super.c:850:6: error: variable 'err' is used uninitialized whenever 'if' condition is false [-Werror,-Wsometimes-uninitialized]
> if (!fsc->sb->s_root) {
> ^~~~~~~~~~~~~~~~
> fs/ceph/super.c:885:9: note: uninitialized use occurs here
> return err;
> ^~~
> fs/ceph/super.c:850:2: note: remove the 'if' if its condition is always true
> if (!fsc->sb->s_root) {
> ^~~~~~~~~~~~~~~~~~~~~~
> fs/ceph/super.c:843:9: note: initialize the variable 'err' to silence this warning
> int err;
> ^
> = 0
>
> Set it to zero if the condition is false.
>
> Fixes: 108f95bfaa56 ("vfs: Convert ceph to use the new mount API")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Thanks for the patch!

Reviewed-by: Nathan Chancellor <natechancellor@gmail.com>

\
 
 \ /
  Last update: 2019-07-08 16:51    [W:1.535 / U:0.240 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site