aboutsummaryrefslogtreecommitdiff
path: root/stand/libsa
diff options
context:
space:
mode:
authorKyle Evans <kevans@FreeBSD.org>2019-05-31 17:44:22 +0000
committerKyle Evans <kevans@FreeBSD.org>2019-05-31 17:44:22 +0000
commit9892cc9ad4a9d6cea297b0aeb11c383aae9cef15 (patch)
treec41f25004e4868e607dc44b3173ad013c94d88ea /stand/libsa
parent8e9105dbaec396077df31db3d055796ce13fc34d (diff)
downloadsrc-9892cc9ad4a9d6cea297b0aeb11c383aae9cef15.tar.gz
src-9892cc9ad4a9d6cea297b0aeb11c383aae9cef15.zip
stand: zfs: Free bouncebuf on error path in vdev_read
r344226 inadvertently added this path in which we return from failure on an lseek and do not free bouncebuf on the way out. MFC after: 3 days
Notes
Notes: svn path=/head/; revision=348471
Diffstat (limited to 'stand/libsa')
-rw-r--r--stand/libsa/zfs/zfs.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/stand/libsa/zfs/zfs.c b/stand/libsa/zfs/zfs.c
index 86fd3129318e..c4d3df4244d4 100644
--- a/stand/libsa/zfs/zfs.c
+++ b/stand/libsa/zfs/zfs.c
@@ -425,8 +425,10 @@ vdev_read(vdev_t *vdev, void *priv, off_t offset, void *buf, size_t bytes)
}
}
- if (lseek(fd, start_sec * secsz, SEEK_SET) == -1)
- return (errno);
+ if (lseek(fd, start_sec * secsz, SEEK_SET) == -1) {
+ ret = errno;
+ goto error;
+ }
/* Partial data return from first sector */
if (head > 0) {