* [PATCH for-next] io_uring: remove redundant NULL check before kfree
@ 2026-06-25 14:37 Subasri S
0 siblings, 0 replies; only message in thread
From: Subasri S @ 2026-06-25 14:37 UTC (permalink / raw)
To: Jens Axboe; +Cc: io-uring, linux-kernel, Subasri S
Remove the unnecessary NULL pointer check before calling kfree()
in io_uring.c, as kfree() handles NULL arguments internally.
Reported by ifnullfree.cocci Coccinelle semantic
patch script.
Signed-off-by: Subasri S <subasris1210@gmail.com>
---
io_uring/io_uring.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c
index 1ea2fca34a36..ac499722aaee 100644
--- a/io_uring/io_uring.c
+++ b/io_uring/io_uring.c
@@ -1114,8 +1114,7 @@ static void io_free_batch_list(struct io_ring_ctx *ctx,
if ((req->flags & REQ_F_POLLED) && req->apoll) {
struct async_poll *apoll = req->apoll;
- if (apoll->double_poll)
- kfree(apoll->double_poll);
+ kfree(apoll->double_poll);
io_cache_free(&ctx->apoll_cache, apoll);
req->flags &= ~REQ_F_POLLED;
}
--
2.43.0
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-06-25 14:37 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-25 14:37 [PATCH for-next] io_uring: remove redundant NULL check before kfree Subasri S
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox