Skip to content

Commit

Permalink
ubifs: Initialize fstr_real_len
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Richard Weinberger <[email protected]>
  • Loading branch information
richardweinberger committed Dec 14, 2016
1 parent ec9160d commit ba75d57
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/ubifs/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit ba75d57

Please sign in to comment.