From d421a19d6e45fca61d9d2eb22b91ad19b52e2d39 Mon Sep 17 00:00:00 2001 From: alc Date: Sat, 21 Aug 2004 18:50:34 +0000 Subject: Properly free the temporary sf_buf in uiomove_fromphys() if a copyin or copyout fails. Obtained from: DragonFlyBSD --- sys/sparc64/sparc64/uio_machdep.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'sys/sparc64') diff --git a/sys/sparc64/sparc64/uio_machdep.c b/sys/sparc64/sparc64/uio_machdep.c index 2999ade..f3e2018 100644 --- a/sys/sparc64/sparc64/uio_machdep.c +++ b/sys/sparc64/sparc64/uio_machdep.c @@ -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) -- cgit v1.1