mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-12 14:29:28 +00:00
Properly free the temporary sf_buf in uiomove_fromphys() if a copyin or
copyout fails. Obtained from: DragonFlyBSD
This commit is contained in:
parent
85bafe5ec3
commit
0b6a0b955a
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=134127
@ -94,8 +94,10 @@ uiomove_fromphys(vm_page_t ma[], vm_offset_t offset, int n, struct uio *uio)
|
||||
error = copyout(cp, iov->iov_base, cnt);
|
||||
else
|
||||
error = copyin(iov->iov_base, cp, cnt);
|
||||
if (error)
|
||||
if (error) {
|
||||
sf_buf_free(sf);
|
||||
goto out;
|
||||
}
|
||||
break;
|
||||
case UIO_SYSSPACE:
|
||||
if (uio->uio_rw == UIO_READ)
|
||||
|
@ -107,8 +107,11 @@ uiomove_fromphys(vm_page_t ma[], vm_offset_t offset, int n, struct uio *uio)
|
||||
error = copyout(cp, iov->iov_base, cnt);
|
||||
else
|
||||
error = copyin(iov->iov_base, cp, cnt);
|
||||
if (error)
|
||||
if (error) {
|
||||
if (sf != NULL)
|
||||
sf_buf_free(sf);
|
||||
goto out;
|
||||
}
|
||||
break;
|
||||
case UIO_SYSSPACE:
|
||||
if (uio->uio_rw == UIO_READ)
|
||||
|
Loading…
Reference in New Issue
Block a user