vm_reserv_from_page returns an existing reservation, or initializes a successor pointer, or both. If it returns an existing reservation, callers will ignore the successor pointer, initialized or not, so initializing it serves no purpose. So, don't initialize it in that case, and make less ambiguous the comment that describes the function's behavior.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
Comment Actions
Doesn't this leave msucc uninitialized in vm_reserv_from_object()'s callers? I think we can then reach a msucc != NULL test there even if vm_reserv_from_object() returns a non-NULL pointer.
Comment Actions
Only if the function returns a non-NULL value.
I think we can then reach a msucc != NULL test there even if vm_reserv_from_object() returns a non-NULL pointer.
I disagree. After each call, an rv != NULL test leads to a block that includes return statements, with no way to avoid encountering one of them.