Skip to content
Commit 33844e66 authored by Al Viro's avatar Al Viro
Browse files

[iov_iter] fix iterate_all_kinds() on empty iterators



Problem similar to ones dealt with in "fold checks into iterate_and_advance()"
and followups, except that in this case we really want to do nothing when
asked for zero-length operation - unlike zero-length iterate_and_advance(),
zero-length iterate_all_kinds() has no side effects, and callers are simpler
that way.

That got exposed when copy_from_iter_full() had been used by tipc, which
builds an msghdr with zero payload and (now) feeds it to a primitive
based on iterate_all_kinds() instead of iterate_and_advance().

Reported-by: default avatarJon Maloy <jon.maloy@ericsson.com>
Tested-by: default avatarJon Maloy <jon.maloy@ericsson.com>
Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent c00d2c7e
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment