test/socket-rw: Fix UB, accessing dead object
test/socket-rw: Fix UB, accessing dead object

Dereference to a local variable that has been out of its scope is
undefined behavior, it may contain garbage or the compiler may
reuse it for other local variables.

Fix this by moving the struct iov variable declarations so their
lifetime is extended.

Cc: Jens Axboe <cd8c6775e60d6f67a6984377324e5290df3d5358@kernel.dk>
Cc: Hrvoje Zeba <7fe4299605bef6b9e0a6010f440e7caed6591bdc@gmail.com>
Fixes: 79ba71a4881fb1cd300520553d7285b3c5ee1293 ("Add deadlock socket read/write test case")
Signed-off-by: Ammar Faizi <a8266392a329a5c7b5ab982a8996391d75b6438e@gnuweeb.org>
Link: https://lore.kernel.org/r/20220107130218.1238910-3-a8266392a329a5c7b5ab982a8996391d75b6438e@gnuweeb.org
Signed-off-by: Jens Axboe <cd8c6775e60d6f67a6984377324e5290df3d5358@kernel.dk>

axboe/liburing,axboe/liburing,axboe/liburing