]> git.baikalelectronics.ru Git - kernel.git/commit
io_uring: only call kfree() for a non-zero pointer
authorJens Axboe <axboe@kernel.dk>
Wed, 8 Jul 2020 21:15:26 +0000 (15:15 -0600)
committerJens Axboe <axboe@kernel.dk>
Wed, 8 Jul 2020 21:15:26 +0000 (15:15 -0600)
commit9dc42ff61f85bee69104dbe9d4207e510d3c1942
tree49c2ee71d9449bcfdcffd6c5670ac0dd6edd7073
parent18058ed3e0bff4d5d7635cca48e8b83b7a390a7b
io_uring: only call kfree() for a non-zero pointer

It's safe to call kfree() with a NULL pointer, but it's also pointless.
Most of the time we don't have any data to free, and at millions of
requests per second, the redundant function call adds noticeable
overhead (about 1.3% of the runtime).

Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/io_uring.c