diff options
author | markj <markj@FreeBSD.org> | 2016-02-22 20:18:10 +0000 |
---|---|---|
committer | markj <markj@FreeBSD.org> | 2016-02-22 20:18:10 +0000 |
commit | 8c646bef996ac776439673158c28a92d047dd03a (patch) | |
tree | 3eff49c417b513c7802278c4e9ec08bf00ad538e /sys/fs/tmpfs/tmpfs_vnops.c | |
parent | b899cad3faf3673f41a3fcf021164dcd7ee19a7e (diff) | |
download | FreeBSD-src-8c646bef996ac776439673158c28a92d047dd03a.zip FreeBSD-src-8c646bef996ac776439673158c28a92d047dd03a.tar.gz |
MFC r295574:
Clear the cookie pointer on error in tmpfs_readdir().
Approved by: re (glebius)
Diffstat (limited to 'sys/fs/tmpfs/tmpfs_vnops.c')
-rw-r--r-- | sys/fs/tmpfs/tmpfs_vnops.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/fs/tmpfs/tmpfs_vnops.c b/sys/fs/tmpfs/tmpfs_vnops.c index 885f84c..f01c8be 100644 --- a/sys/fs/tmpfs/tmpfs_vnops.c +++ b/sys/fs/tmpfs/tmpfs_vnops.c @@ -1187,8 +1187,11 @@ tmpfs_readdir(struct vop_readdir_args *v) if (error == EJUSTRETURN) error = (uio->uio_resid != startresid) ? 0 : EINVAL; - if (error != 0 && cookies != NULL) + if (error != 0 && cookies != NULL && ncookies != NULL) { free(*cookies, M_TEMP); + *cookies = NULL; + *ncookies = 0; + } if (eofflag != NULL) *eofflag = |