lkml.org 
[lkml]   [2019]   [Jul]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] fuse: BUG_ON's correction in fuse_dev_splice_write()
Date
commit 963545357202 ("fuse: reduce allocation size for splice_write")
changed size of bufs array, so first BUG_ON should be corrected too.
Second BUG_ON become useless, first one also includes the second check:
any unsigned nbuf value cannot be less than 0.

Fixes: 963545357202 ("fuse: reduce allocation size for splice_write")
Signed-off-by: Vasily Averin <vvs@virtuozzo.com>
---
fs/fuse/dev.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c
index ea8237513dfa..311c7911271c 100644
--- a/fs/fuse/dev.c
+++ b/fs/fuse/dev.c
@@ -2064,8 +2064,7 @@ static ssize_t fuse_dev_splice_write(struct pipe_inode_info *pipe,
struct pipe_buffer *ibuf;
struct pipe_buffer *obuf;

- BUG_ON(nbuf >= pipe->buffers);
- BUG_ON(!pipe->nrbufs);
+ BUG_ON(nbuf >= pipe->nrbufs);
ibuf = &pipe->bufs[pipe->curbuf];
obuf = &bufs[nbuf];

--
2.17.1
\
 
 \ /
  Last update: 2019-07-23 08:34    [W:0.063 / U:0.640 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site