Re: [PATCH 1/1] lib/iov_iter: fix import_iovec_ubuf iovec management
From: Jens Axboe
Date: Fri Jan 31 2025 - 11:12:52 EST
On 1/31/25 9:06 AM, Pavel Begunkov wrote:
> On 1/31/25 14:13, Pavel Begunkov wrote:
>> import_iovec() says that it should always be fine to kfree the iovec
>> returned in @iovp regardless of the error code. __import_iovec_ubuf()
>> never reallocates it and thus should clear the pointer even in cases
>> when copy_iovec_*() fail.
>
> To be fair, all callers I checked don't look at the returned iovec
> if import_iovec*() fails, but I didn't track down all of them.
Yep I also checked too and didn't spot any issues from this, but it's
still prudent to clean it up.
--
Jens Axboe