MFC r294317: Declare local variables at top of function.
Sponsored by: Mellanox Technologies Differential Revision: https://reviews.freebsd.org/D4939