[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220602071841.278214-1-chi.minghao@zte.com.cn>
Date: Thu, 2 Jun 2022 07:18:41 +0000
From: cgel.zte@...il.com
To: axboe@...nel.dk
Cc: asml.silence@...il.com, io-uring@...r.kernel.org,
linux-kernel@...r.kernel.org, Minghao Chi <chi.minghao@....com.cn>,
Zeal Robot <zealci@....com.cn>
Subject: [PATCH] io_uring: Remove redundant NULL check before kfree
From: Minghao Chi <chi.minghao@....com.cn>
kfree on NULL pointer is a no-op.
Reported-by: Zeal Robot <zealci@....com.cn>
Signed-off-by: Minghao Chi <chi.minghao@....com.cn>
---
fs/io_uring.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/fs/io_uring.c b/fs/io_uring.c
index 1fc0166d9133..d1fe967f2343 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -4445,8 +4445,7 @@ static int io_read(struct io_kiocb *req, unsigned int issue_flags)
kiocb_done(req, ret, issue_flags);
out_free:
/* it's faster to check here then delegate to kfree */
- if (iovec)
- kfree(iovec);
+ kfree(iovec);
return 0;
}
--
2.25.1
Powered by blists - more mailing lists