Skip to content

Commit 0e9fb6f

Browse files
vaverinMiklos Szeredi
authored andcommitted
fuse: BUG_ON correction in fuse_dev_splice_write()
commit 9635453 ("fuse: reduce allocation size for splice_write") changed size of bufs array, so BUG_ON which checks the index of the array shold also be fixed. [SzM: turn BUG_ON into WARN_ON] Fixes: 9635453 ("fuse: reduce allocation size for splice_write") Signed-off-by: Vasily Averin <[email protected]> Signed-off-by: Miklos Szeredi <[email protected]>
1 parent a5d8422 commit 0e9fb6f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

fs/fuse/dev.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1977,8 +1977,9 @@ static ssize_t fuse_dev_splice_write(struct pipe_inode_info *pipe,
19771977
struct pipe_buffer *ibuf;
19781978
struct pipe_buffer *obuf;
19791979

1980-
BUG_ON(nbuf >= pipe->ring_size);
1981-
BUG_ON(tail == head);
1980+
if (WARN_ON(nbuf >= count || tail == head))
1981+
goto out_free;
1982+
19821983
ibuf = &pipe->bufs[tail & mask];
19831984
obuf = &bufs[nbuf];
19841985

0 commit comments

Comments
 (0)