diff options
author | Latchesar Ionkov <lucho@advancedsolutions.com> | 2006-03-08 00:55:42 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-03-08 17:14:02 -0500 |
commit | 731805b49489055c1548f7ccfbd44c9b84013264 (patch) | |
tree | 8ff2ee8091a911a6dfb15e02bfcb61d7a9af46b7 /fs/9p | |
parent | ed2da193fe6671fe4d7e34041bae40308d18247f (diff) |
[PATCH] v9fs: fix for access to unitialized variables or freed memory
Miscellaneous fixes related to accessing uninitialized variables or memory
that was already freed.
Signed-off-by: Latchesar Ionkov <lucho@ionkov.net>
Cc: Eric Van Hensbergen <ericvh@ericvh.myip.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs/9p')
-rw-r--r-- | fs/9p/9p.c | 1 | ||||
-rw-r--r-- | fs/9p/trans_fd.c | 1 | ||||
-rw-r--r-- | fs/9p/vfs_inode.c | 8 | ||||
-rw-r--r-- | fs/9p/vfs_super.c | 1 |
4 files changed, 4 insertions, 7 deletions
diff --git a/fs/9p/9p.c b/fs/9p/9p.c index 1a6d08761f39..f86a28d1d6a6 100644 --- a/fs/9p/9p.c +++ b/fs/9p/9p.c | |||
@@ -111,7 +111,6 @@ static void v9fs_t_clunk_cb(void *a, struct v9fs_fcall *tc, | |||
111 | if (!rc) | 111 | if (!rc) |
112 | return; | 112 | return; |
113 | 113 | ||
114 | dprintk(DEBUG_9P, "tcall id %d rcall id %d\n", tc->id, rc->id); | ||
115 | v9ses = a; | 114 | v9ses = a; |
116 | if (rc->id == RCLUNK) | 115 | if (rc->id == RCLUNK) |
117 | v9fs_put_idpool(fid, &v9ses->fidpool); | 116 | v9fs_put_idpool(fid, &v9ses->fidpool); |
diff --git a/fs/9p/trans_fd.c b/fs/9p/trans_fd.c index 1a28ef97a3d1..5b2ce21b10fa 100644 --- a/fs/9p/trans_fd.c +++ b/fs/9p/trans_fd.c | |||
@@ -80,6 +80,7 @@ static int v9fs_fd_send(struct v9fs_transport *trans, void *v, int len) | |||
80 | if (!trans || trans->status != Connected || !ts) | 80 | if (!trans || trans->status != Connected || !ts) |
81 | return -EIO; | 81 | return -EIO; |
82 | 82 | ||
83 | oldfs = get_fs(); | ||
83 | set_fs(get_ds()); | 84 | set_fs(get_ds()); |
84 | /* The cast to a user pointer is valid due to the set_fs() */ | 85 | /* The cast to a user pointer is valid due to the set_fs() */ |
85 | ret = vfs_write(ts->out_file, (void __user *)v, len, &ts->out_file->f_pos); | 86 | ret = vfs_write(ts->out_file, (void __user *)v, len, &ts->out_file->f_pos); |
diff --git a/fs/9p/vfs_inode.c b/fs/9p/vfs_inode.c index dce729d42869..3ad8455f8577 100644 --- a/fs/9p/vfs_inode.c +++ b/fs/9p/vfs_inode.c | |||
@@ -265,8 +265,7 @@ v9fs_create(struct v9fs_session_info *v9ses, u32 pfid, char *name, | |||
265 | fid = v9fs_get_idpool(&v9ses->fidpool); | 265 | fid = v9fs_get_idpool(&v9ses->fidpool); |
266 | if (fid < 0) { | 266 | if (fid < 0) { |
267 | eprintk(KERN_WARNING, "no free fids available\n"); | 267 | eprintk(KERN_WARNING, "no free fids available\n"); |
268 | err = -ENOSPC; | 268 | return -ENOSPC; |
269 | goto error; | ||
270 | } | 269 | } |
271 | 270 | ||
272 | err = v9fs_t_walk(v9ses, pfid, fid, NULL, &fcall); | 271 | err = v9fs_t_walk(v9ses, pfid, fid, NULL, &fcall); |
@@ -313,8 +312,7 @@ v9fs_clone_walk(struct v9fs_session_info *v9ses, u32 fid, struct dentry *dentry) | |||
313 | nfid = v9fs_get_idpool(&v9ses->fidpool); | 312 | nfid = v9fs_get_idpool(&v9ses->fidpool); |
314 | if (nfid < 0) { | 313 | if (nfid < 0) { |
315 | eprintk(KERN_WARNING, "no free fids available\n"); | 314 | eprintk(KERN_WARNING, "no free fids available\n"); |
316 | err = -ENOSPC; | 315 | return ERR_PTR(-ENOSPC); |
317 | goto error; | ||
318 | } | 316 | } |
319 | 317 | ||
320 | err = v9fs_t_walk(v9ses, fid, nfid, (char *) dentry->d_name.name, | 318 | err = v9fs_t_walk(v9ses, fid, nfid, (char *) dentry->d_name.name, |
@@ -612,7 +610,7 @@ static struct dentry *v9fs_vfs_lookup(struct inode *dir, struct dentry *dentry, | |||
612 | int result = 0; | 610 | int result = 0; |
613 | 611 | ||
614 | dprintk(DEBUG_VFS, "dir: %p dentry: (%s) %p nameidata: %p\n", | 612 | dprintk(DEBUG_VFS, "dir: %p dentry: (%s) %p nameidata: %p\n", |
615 | dir, dentry->d_iname, dentry, nameidata); | 613 | dir, dentry->d_name.name, dentry, nameidata); |
616 | 614 | ||
617 | sb = dir->i_sb; | 615 | sb = dir->i_sb; |
618 | v9ses = v9fs_inode2v9ses(dir); | 616 | v9ses = v9fs_inode2v9ses(dir); |
diff --git a/fs/9p/vfs_super.c b/fs/9p/vfs_super.c index cdf787ee08de..d05318fa684e 100644 --- a/fs/9p/vfs_super.c +++ b/fs/9p/vfs_super.c | |||
@@ -156,7 +156,6 @@ static struct super_block *v9fs_get_sb(struct file_system_type | |||
156 | stat_result = v9fs_t_stat(v9ses, newfid, &fcall); | 156 | stat_result = v9fs_t_stat(v9ses, newfid, &fcall); |
157 | if (stat_result < 0) { | 157 | if (stat_result < 0) { |
158 | dprintk(DEBUG_ERROR, "stat error\n"); | 158 | dprintk(DEBUG_ERROR, "stat error\n"); |
159 | kfree(fcall); | ||
160 | v9fs_t_clunk(v9ses, newfid); | 159 | v9fs_t_clunk(v9ses, newfid); |
161 | } else { | 160 | } else { |
162 | /* Setup the Root Inode */ | 161 | /* Setup the Root Inode */ |