Re: [PATCH 1/1] lib/iov_iter: fix import_iovec_ubuf iovec management

From: Pavel Begunkov
Date: Fri Jan 31 2025 - 11:06:53 EST


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.

--
Pavel Begunkov