linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next] io_uring: Remove unnecessary null check
@ 2020-01-07 14:22 YueHaibing
  2020-01-07 17:03 ` Jens Axboe
  0 siblings, 1 reply; 2+ messages in thread
From: YueHaibing @ 2020-01-07 14:22 UTC (permalink / raw)
  To: viro, axboe; +Cc: linux-fsdevel, io-uring, linux-kernel, YueHaibing

Null check kfree is redundant, so remove it.
This is detected by coccinelle.

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
 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 60ebdea..cb929e5 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -1157,8 +1157,7 @@ static void __io_req_aux_free(struct io_kiocb *req)
 {
 	struct io_ring_ctx *ctx = req->ctx;
 
-	if (req->io)
-		kfree(req->io);
+	kfree(req->io);
 	if (req->file) {
 		if (req->flags & REQ_F_FIXED_FILE)
 			percpu_ref_put(&ctx->file_data->refs);
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH -next] io_uring: Remove unnecessary null check
  2020-01-07 14:22 [PATCH -next] io_uring: Remove unnecessary null check YueHaibing
@ 2020-01-07 17:03 ` Jens Axboe
  0 siblings, 0 replies; 2+ messages in thread
From: Jens Axboe @ 2020-01-07 17:03 UTC (permalink / raw)
  To: YueHaibing, viro; +Cc: linux-fsdevel, io-uring, linux-kernel

On 1/7/20 7:22 AM, YueHaibing wrote:
> Null check kfree is redundant, so remove it.
> This is detected by coccinelle.

Applied, thanks.

-- 
Jens Axboe


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-01-07 17:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-07 14:22 [PATCH -next] io_uring: Remove unnecessary null check YueHaibing
2020-01-07 17:03 ` Jens Axboe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).