public inbox for [email protected]
 help / color / mirror / Atom feed
* [PATCH] io_uring: Remove unneeded if check in io_free_batch_list()
@ 2024-08-11 22:28 Thorsten Blum
  0 siblings, 0 replies; only message in thread
From: Thorsten Blum @ 2024-08-11 22:28 UTC (permalink / raw)
  To: axboe, asml.silence; +Cc: io-uring, linux-kernel, Thorsten Blum

kfree() already checks if its argument is NULL. Remove the unneeded if
check and fix the following Coccinelle/coccicheck warning reported by
ifnullfree.cocci:

  WARNING: NULL check before some freeing functions is not needed

Signed-off-by: Thorsten Blum <[email protected]>
---
 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 3942db160f18..7597b9dcab28 100644
--- a/io_uring/io_uring.c
+++ b/io_uring/io_uring.c
@@ -1382,8 +1382,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);
 				if (!io_alloc_cache_put(&ctx->apoll_cache, apoll))
 					kfree(apoll);
 				req->flags &= ~REQ_F_POLLED;
-- 
2.46.0


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2024-08-11 22:28 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-11 22:28 [PATCH] io_uring: Remove unneeded if check in io_free_batch_list() Thorsten Blum

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox