diff options
-rw-r--r-- | sys/i386/i386/uio_machdep.c | 4 | ||||
-rw-r--r-- | sys/sparc64/sparc64/uio_machdep.c | 5 |
2 files changed, 7 insertions, 2 deletions
diff --git a/sys/i386/i386/uio_machdep.c b/sys/i386/i386/uio_machdep.c index 27408c3..14cd38c 100644 --- a/sys/i386/i386/uio_machdep.c +++ b/sys/i386/i386/uio_machdep.c @@ -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) 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) |