staging/lustre/llite: Fix a compile warning.
authorOleg Drokin <green@linuxhacker.ru>
Sun, 27 Apr 2014 18:42:29 +0000 (14:42 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 27 Apr 2014 19:51:52 +0000 (12:51 -0700)
Quiet the warning below in Lustre code.
Actually the warning is invalid since we either always assign
the symname in ll_readlink_internal or return an error there and
then the following rc check would assign symlink variable explicitly.

In file included from /home/green/bk/linux/drivers/staging/lustre/lustre/llite/../include/linux/lustre_compat25.h:41:0,
                 from /home/green/bk/linux/drivers/staging/lustre/lustre/llite/../include/linux/lvfs.h:48,
                 from /home/green/bk/linux/drivers/staging/lustre/lustre/llite/../include/lvfs.h:45,
                 from /home/green/bk/linux/drivers/staging/lustre/lustre/llite/../include/obd_support.h:41,
                 from /home/green/bk/linux/drivers/staging/lustre/lustre/llite/../include/obd_class.h:40,
                 from /home/green/bk/linux/drivers/staging/lustre/lustre/llite/../include/linux/lustre_lite.h:49,
                 from /home/green/bk/linux/drivers/staging/lustre/lustre/llite/../include/lustre_lite.h:45,
                 from /home/green/bk/linux/drivers/staging/lustre/lustre/llite/symlink.c:42:
/home/green/bk/linux/drivers/staging/lustre/lustre/llite/symlink.c: In function ‘ll_follow_link’:
/home/green/bk/linux/include/linux/namei.h:88:29: warning: ‘symname’ may be used uninitialized in this function [-Wmaybe-uninitialized]
  nd->saved_names[nd->depth] = path;
                             ^
/home/green/bk/linux/drivers/staging/lustre/lustre/llite/symlink.c:123:8: note: ‘symname’ was declared here
  char *symname;
        ^

Signed-off-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/lustre/lustre/llite/symlink.c

index 80d48b5ae24706655c0290ad01f59bb1591f3912..129d3023dcea817da79a0bcb8d6f673f89a1e974 100644 (file)
@@ -120,7 +120,7 @@ static void *ll_follow_link(struct dentry *dentry, struct nameidata *nd)
        struct inode *inode = dentry->d_inode;
        struct ptlrpc_request *request = NULL;
        int rc;
-       char *symname;
+       char *symname = NULL;
 
        CDEBUG(D_VFSTRACE, "VFS Op\n");
        /* Limit the recursive symlink depth to 5 instead of default