diff options
author | Xinghui Li <korantli@tencent.com> | 2022-11-02 16:25:03 +0800 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2022-11-21 07:38:31 -0700 |
commit | df730ec21f7ba395b1b22e7f93a3a85b1d1b7882 (patch) | |
tree | 04dceaca9972b2acc06a905cc7a77ced4d506a85 /io_uring/poll.c | |
parent | 42385b02baad0df55474b7f36dc13e0d4ffd0cc0 (diff) |
io_uring: fix two assignments in if conditions
Fixes two errors:
"ERROR: do not use assignment in if condition
130: FILE: io_uring/net.c:130:
+ if (!(issue_flags & IO_URING_F_UNLOCKED) &&
ERROR: do not use assignment in if condition
599: FILE: io_uring/poll.c:599:
+ } else if (!(issue_flags & IO_URING_F_UNLOCKED) &&"
reported by checkpatch.pl in net.c and poll.c .
Signed-off-by: Xinghui Li <korantli@tencent.com>
Reported-by: kernel test robot <lkp@intel.com>
Link: https://lore.kernel.org/r/20221102082503.32236-1-korantwork@gmail.com
[axboe: style tweaks]
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'io_uring/poll.c')
-rw-r--r-- | io_uring/poll.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/io_uring/poll.c b/io_uring/poll.c index 055632e9092a..58e02d963961 100644 --- a/io_uring/poll.c +++ b/io_uring/poll.c @@ -615,10 +615,13 @@ static struct async_poll *io_req_alloc_apoll(struct io_kiocb *req, if (req->flags & REQ_F_POLLED) { apoll = req->apoll; kfree(apoll->double_poll); - } else if (!(issue_flags & IO_URING_F_UNLOCKED) && - (entry = io_alloc_cache_get(&ctx->apoll_cache)) != NULL) { + } else if (!(issue_flags & IO_URING_F_UNLOCKED)) { + entry = io_alloc_cache_get(&ctx->apoll_cache); + if (entry == NULL) + goto alloc_apoll; apoll = container_of(entry, struct async_poll, cache); } else { +alloc_apoll: apoll = kmalloc(sizeof(*apoll), GFP_ATOMIC); if (unlikely(!apoll)) return NULL; |