All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] fs/ecryptfs/inode.c warnings
@ 2011-05-09  5:49 Connor H
  0 siblings, 0 replies; only message in thread
From: Connor H @ 2011-05-09  5:49 UTC (permalink / raw)
  To: linux-kernel

Warnings popped up in fs/ecryptfs/inode.c with 2.6.39-rc6

fs/ecryptfs/inode.c: In function 'ecryptfs_do_create':
fs/ecryptfs/inode.c:72: warning: 'dentry_save' may be used
uninitialized in this function
fs/ecryptfs/inode.c:72: note: 'dentry_save' was declared here
fs/ecryptfs/inode.c:73: warning: 'vfsmount_save' may be used
uninitialized in this function
fs/ecryptfs/inode.c:73: note: 'vfsmount_save' was declared here
fs/ecryptfs/inode.c:74: warning: 'flags_save' may be used
uninitialized in this function
fs/ecryptfs/inode.c:74: note: 'flags_save' was declared here

patch sets rc to error and removes the need for two if statements.

-Connor

--- a/fs/ecryptfs/inode.c       2011-05-03 23:28:26.000000000 +0000
+++ b/fs/ecryptfs/inode.c       2011-05-08 22:10:43.000000000 +0000
@@ -69,21 +69,18 @@
 {
       struct dentry *lower_dentry = ecryptfs_dentry_to_lower(dentry);
       struct vfsmount *lower_mnt = ecryptfs_dentry_to_lower_mnt(dentry);
-       struct dentry *dentry_save;
-       struct vfsmount *vfsmount_save;
-       unsigned int flags_save;
-       int rc;
+       int rc = -EIO;

       if (nd) {
-               dentry_save = nd->path.dentry;
-               vfsmount_save = nd->path.mnt;
-               flags_save = nd->flags;
+               struct dentry *dentry_save = nd->path.dentry;
+               struct vfsmount *vfsmount_save = nd->path.mnt;
+               unsigned int flags_save = nd->flags;
               nd->path.dentry = lower_dentry;
               nd->path.mnt = lower_mnt;
               nd->flags &= ~LOOKUP_OPEN;
-       }
-       rc = vfs_create(lower_dir_inode, lower_dentry, mode, nd);
-       if (nd) {
+
+               rc = vfs_create(lower_dir_inode, lower_dentry, mode, nd);
+
               nd->path.dentry = dentry_save;
               nd->path.mnt = vfsmount_save;
               nd->flags = flags_save;

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2011-05-09  5:49 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-05-09  5:49 [PATCH] fs/ecryptfs/inode.c warnings Connor H

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.