[PATCH] afs: Fix compile warning in afs_dynroot_lookup()

From: Tiezhu Yang
Date: Thu Dec 19 2019 - 08:15:34 EST


Fix the following compile warning:

CC fs/afs/dynroot.o
fs/afs/dynroot.c: In function âafs_dynroot_lookupâ:
fs/afs/dynroot.c:117:6: warning: âlenâ may be used uninitialized in this function [-Wmaybe-uninitialized]
ret = lookup_one_len(name, dentry->d_parent, len);
^
fs/afs/dynroot.c:91:6: note: âlenâ was declared here
int len;
^

Signed-off-by: Tiezhu Yang <yangtiezhu@xxxxxxxxxxx>
---
fs/afs/dynroot.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/afs/dynroot.c b/fs/afs/dynroot.c
index 7503899..303f712 100644
--- a/fs/afs/dynroot.c
+++ b/fs/afs/dynroot.c
@@ -88,7 +88,7 @@ static struct dentry *afs_lookup_atcell(struct dentry *dentry)
struct dentry *ret;
unsigned int seq = 0;
char *name;
- int len;
+ int len = 0;

if (!net->ws_cell)
return ERR_PTR(-ENOENT);
--
2.1.0