From: Richard Weinberger Date: Wed, 14 Dec 2016 10:09:25 +0000 (+0100) Subject: ubifs: Initialize fstr_real_len X-Git-Tag: v5.15~12248^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ba75d570b60c05cda21c0b43c5fbdc4e344f892d;p=platform%2Fkernel%2Flinux-starfive.git ubifs: Initialize fstr_real_len While fstr_real_len is only being used under if (encrypted), gcc-6 still warns. Fixes this false positive: fs/ubifs/dir.c: In function 'ubifs_readdir': fs/ubifs/dir.c:629:13: warning: 'fstr_real_len' may be used uninitialized in this function [-Wmaybe-uninitialized] fstr.len = fstr_real_len Initialize fstr_real_len to make gcc happy. Reported-by: Stephen Rothwell Signed-off-by: Richard Weinberger --- diff --git a/fs/ubifs/dir.c b/fs/ubifs/dir.c index 7f01f3d..1c5331a 100644 --- a/fs/ubifs/dir.c +++ b/fs/ubifs/dir.c @@ -528,7 +528,7 @@ static unsigned int vfs_dent_type(uint8_t type) */ static int ubifs_readdir(struct file *file, struct dir_context *ctx) { - int fstr_real_len, err = 0; + int fstr_real_len = 0, err = 0; struct fscrypt_name nm; struct fscrypt_str fstr = {0}; union ubifs_key key;