Skip to content

Commit

Permalink
fuse: add missing fuse_request_free
Browse files Browse the repository at this point in the history
The error handling code for the second call to fuse_request_alloc should
include freeing the result of the first one.

This bug was found by the Coccinelle project:

  http://www.emn.fr/x-info/coccinelle/

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
  • Loading branch information
Julia Lawall authored and Miklos Szeredi committed Oct 16, 2008
1 parent 769415c commit 17e18ab
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion fs/fuse/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -865,7 +865,7 @@ static int fuse_fill_super(struct super_block *sb, void *data, int silent)
if (is_bdev) {
fc->destroy_req = fuse_request_alloc();
if (!fc->destroy_req)
goto err_put_root;
goto err_free_init_req;
}

mutex_lock(&fuse_mutex);
Expand Down Expand Up @@ -895,6 +895,7 @@ static int fuse_fill_super(struct super_block *sb, void *data, int silent)

err_unlock:
mutex_unlock(&fuse_mutex);
err_free_init_req:
fuse_request_free(init_req);
err_put_root:
dput(root_dentry);
Expand Down

0 comments on commit 17e18ab

Please sign in to comment.