Date: Mon, 22 Feb 2016 20:18:10 +0000 (UTC) From: Mark Johnston <markj@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r295897 - stable/10/sys/fs/tmpfs Message-ID: <201602222018.u1MKIAIb088348@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: markj Date: Mon Feb 22 20:18:10 2016 New Revision: 295897 URL: https://svnweb.freebsd.org/changeset/base/295897 Log: MFC r295574: Clear the cookie pointer on error in tmpfs_readdir(). Approved by: re (glebius) Modified: stable/10/sys/fs/tmpfs/tmpfs_vnops.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/fs/tmpfs/tmpfs_vnops.c ============================================================================== --- stable/10/sys/fs/tmpfs/tmpfs_vnops.c Mon Feb 22 19:17:59 2016 (r295896) +++ stable/10/sys/fs/tmpfs/tmpfs_vnops.c Mon Feb 22 20:18:10 2016 (r295897) @@ -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 =
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201602222018.u1MKIAIb088348>