NULL check before kfree() is not needed Signed-off-by: Wu Bo <wubo40@xxxxxxxxxx> --- fs/io_uring.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/fs/io_uring.c b/fs/io_uring.c index 2a3af95..59c19c8 100644 --- a/fs/io_uring.c +++ b/fs/io_uring.c @@ -1537,8 +1537,7 @@ static void io_dismantle_req(struct io_kiocb *req) { io_clean_op(req); - if (req->io) - kfree(req->io); + kfree(req->io); if (req->file) io_put_file(req, req->file, (req->flags & REQ_F_FIXED_FILE)); io_req_clean_work(req); @@ -3111,8 +3110,7 @@ static int io_read(struct io_kiocb *req, bool force_nonblock, return -EAGAIN; } out_free: - if (iovec) - kfree(iovec); + kfree(iovec); return ret; } @@ -3210,8 +3208,7 @@ static int io_write(struct io_kiocb *req, bool force_nonblock, return -EAGAIN; } out_free: - if (iovec) - kfree(iovec); + kfree(iovec); return ret; } -- 1.8.3.1