projects
/
linux-block.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8b1df11
)
io_uring/kbuf: remove extra ->buf_ring null check
author
Pavel Begunkov
<asml.silence@gmail.com>
Tue, 11 Apr 2023 11:06:02 +0000
(12:06 +0100)
committer
Jens Axboe
<axboe@kernel.dk>
Wed, 12 Apr 2023 18:09:41 +0000
(12:09 -0600)
The kernel test robot complains about __io_remove_buffers().
io_uring/kbuf.c:221 __io_remove_buffers() warn: variable dereferenced
before check 'bl->buf_ring' (see line 219)
That check is not needed as ->buf_ring will always be set, so we can
remove it and so silence the warning.
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Link:
https://lore.kernel.org/r/9a632bbf749d9d911e605255652ce08d18e7d2c6.1681210788.git.asml.silence@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
io_uring/kbuf.c
patch
|
blob
|
blame
|
history
diff --git
a/io_uring/kbuf.c
b/io_uring/kbuf.c
index 79c25459e8de1d17106e647b35804dea0f6474dc..0905c1761fbabc20fb5df2edb91fd2f8d7a6c563 100644
(file)
--- a/
io_uring/kbuf.c
+++ b/
io_uring/kbuf.c
@@
-218,14
+218,12
@@
static int __io_remove_buffers(struct io_ring_ctx *ctx,
if (bl->is_mapped) {
i = bl->buf_ring->tail - bl->head;
if (bl->is_mmap) {
- if (bl->buf_ring) {
- struct page *page;
-
- page = virt_to_head_page(bl->buf_ring);
- if (put_page_testzero(page))
- free_compound_page(page);
- bl->buf_ring = NULL;
- }
+ struct page *page;
+
+ page = virt_to_head_page(bl->buf_ring);
+ if (put_page_testzero(page))
+ free_compound_page(page);
+ bl->buf_ring = NULL;
bl->is_mmap = 0;
} else if (bl->buf_nr_pages) {
int j;