Home
last modified time | relevance | path

Searched hist:"814 a6674" (Results 1 – 1 of 1) sorted by relevance

/openbmc/linux/lib/
H A Diov_iter.c814a6674 Wed Jul 21 12:03:47 CDT 2021 Andreas Gruenbacher <agruenba@redhat.com> iov_iter: Fix iov_iter_get_pages{,_alloc} page fault return value

Both iov_iter_get_pages and iov_iter_get_pages_alloc return the number
of bytes of the iovec they could get the pages for. When they cannot
get any pages, they're supposed to return 0, but when the start of the
iovec isn't page aligned, the calculation goes wrong and they return a
negative value. Fix both functions.

In addition, change iov_iter_get_pages_alloc to return NULL in that case
to prevent resource leaks.

Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>