diff options
author | Kyle Evans <kevans@FreeBSD.org> | 2019-05-31 17:44:22 +0000 |
---|---|---|
committer | Kyle Evans <kevans@FreeBSD.org> | 2019-05-31 17:44:22 +0000 |
commit | 9892cc9ad4a9d6cea297b0aeb11c383aae9cef15 (patch) | |
tree | c41f25004e4868e607dc44b3173ad013c94d88ea /stand/libsa | |
parent | 8e9105dbaec396077df31db3d055796ce13fc34d (diff) | |
download | src-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.c | 6 |
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) { |