]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ubifs: Initialize fstr_real_len
authorRichard Weinberger <richard@nod.at>
Wed, 14 Dec 2016 10:09:25 +0000 (11:09 +0100)
committerRichard Weinberger <richard@nod.at>
Wed, 14 Dec 2016 16:39:21 +0000 (17:39 +0100)
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 <sfr@canb.auug.org.au>
Signed-off-by: Richard Weinberger <richard@nod.at>
fs/ubifs/dir.c

index 7f01f3d2ac3bc17ebc58086ad4c146459824b9f0..1c5331ac9614040016019aca78c1338133ea4e11 100644 (file)
@@ -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;