Skip to content

Commit

Permalink
fuse: prevent fuse_put_request on invalid pointer
Browse files Browse the repository at this point in the history
fuse_direct_io() has a loop where requests are allocated in each
iteration. if allocation fails, the loop is broken out and follows
into an unconditional fuse_put_request() on that invalid pointer.

Signed-off-by: Anand V. Avati <[email protected]>
Signed-off-by: Miklos Szeredi <[email protected]>
Cc: [email protected]
  • Loading branch information
avati authored and Miklos Szeredi committed Nov 4, 2009
1 parent b419148 commit f60311d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion fs/fuse/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -1063,7 +1063,8 @@ ssize_t fuse_direct_io(struct file *file, const char __user *buf,
break;
}
}
fuse_put_request(fc, req);
if (!IS_ERR(req))
fuse_put_request(fc, req);
if (res > 0)
*ppos = pos;

Expand Down

0 comments on commit f60311d

Please sign in to comment.