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)
commit5acbbc8ed3a9aef71c6eb5f19ba24f7321200220
tree49c2ee71d9449bcfdcffd6c5670ac0dd6edd7073
parentaa340845ae6f019e0a12321a1741c14679bb0664
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