lkml.org 
[lkml]   [2007]   [May]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[-mm patch] do_revoke error handling (was Re: 2.6.21-mm1)
On Sat, May 05, 2007 at 01:49:55AM -0700, Andrew Morton wrote:
>
> ftp://ftp.kernel.org/pub/linux/kernel/people/akpm/patches/2.6/2.6.21/2.6.21-mm1/
>
fs/revoke.c: In function 'do_revoke':
fs/revoke.c:563: warning: 'details.fset' may be used uninitialized in this function
fs/revoke.c:563: warning: 'details.restore_start' may be used uninitialized in this function

It seems that we should goto 'out_free_table' if an error happens in
the mainloop. Otherwise 'details' is passed to restore_files() without
being initialized.

Regards,
Frederik

Signed-off-by: Frederik Deweerdt <frederik.deweerdt@gmail.com>
diff --git a/fs/revoke.c b/fs/revoke.c
index 1f2e3ef..6ab5223 100644
--- a/fs/revoke.c
+++ b/fs/revoke.c
@@ -611,7 +611,7 @@ static int do_revoke(struct inode *inode, struct file *to_exclude)
read_unlock(&tasklist_lock);

if (err)
- goto out_restore;
+ goto out_free_table;

/*
* Take down shared memory mappings.
@@ -623,7 +623,7 @@ static int do_revoke(struct inode *inode, struct file *to_exclude)
*/
err = revoke_break_cow(fset, inode, to_exclude);
if (err)
- goto out_restore;
+ goto out_free_table;

details.fset = fset;
details.restore_start = 0;
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
\
 
 \ /
  Last update: 2007-05-05 23:17    [W:0.322 / U:0.676 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site