In swap_io() allocate the buffer before doing encryption.
authormpi <mpi@openbsd.org>
Thu, 17 Mar 2022 10:15:13 +0000 (10:15 +0000)
committermpi <mpi@openbsd.org>
Thu, 17 Mar 2022 10:15:13 +0000 (10:15 +0000)
commit6bae1a369515911da4f4779ff2dd6027daf35e79
treecece06febd73673c024ae923e3b1f6f6f70e1087
parent259d21117162fe8d7d1e85246bebbbbe2ad86e5e
In swap_io() allocate the buffer before doing encryption.

If the allocation fails due to memory pressure no time is wasted doing
encryption.  This also simplify the error path.

Tested by sthen@.

ok kn@, miod@, kettenis@, tb@
sys/uvm/uvm_swap.c