Skip to content

Commit

Permalink
[PATCH] splice: potential !page dereference
Browse files Browse the repository at this point in the history
We can get to out: with a NULL page, which we probably
don't want to be calling page_cache_release() on.

Signed-off-by: Dave Jones <davej@redhat.com>
Signed-off-by: Jens Axboe <axboe@suse.de>
  • Loading branch information
Dave Jones authored and Jens Axboe committed Apr 10, 2006
1 parent c7f21e4 commit 9aefe43
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion fs/splice.c
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@ static int pipe_to_file(struct pipe_inode_info *info, struct pipe_buffer *buf,
ret = -ENOMEM;
page = find_or_create_page(mapping, index, gfp_mask);
if (!page)
goto out;
goto out_nomem;

/*
* If the page is uptodate, it is also locked. If it isn't
Expand Down Expand Up @@ -508,6 +508,7 @@ static int pipe_to_file(struct pipe_inode_info *info, struct pipe_buffer *buf,
page_cache_release(page);
unlock_page(page);
}
out_nomem:
buf->ops->unmap(info, buf);
return ret;
}
Expand Down

0 comments on commit 9aefe43

Please sign in to comment.