linux-user/syscall.c: lock_iovec: unlock vec[i] in failure processing code block
commit7eff518b6c91bdd62710dd9868ec7a17bd6f1434
authorChen Gang S <gang.chen@sunrus.com.cn>
Fri, 23 Jan 2015 10:01:09 +0000 (23 18:01 +0800)
committerMichael Tokarev <mjt@tls.msk.ru>
Tue, 10 Feb 2015 06:27:20 +0000 (10 09:27 +0300)
tree077fcaa6aadba40c21c0e82a520bd82c28a6bc2c
parent88ea8ed74cb6956f43199a098ca4963ae73bba57
linux-user/syscall.c: lock_iovec: unlock vec[i] in failure processing code block

When failure occurs during locking of vec[i], we also need to unlock all
already locked vec[i] in failure processing code block before return.

Code in unlock_user() checks vec[i].iov_base for NULL, so there's no
need not check it .

If error is EFAULT when "i == 0", vec[i].iov_base is NULL, we can just
skip it, so can still use "while (--i >= 0)" loop condition.

Signed-off-by: Chen Gang <gang.chen.5i5j@gmail.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
linux-user/syscall.c