X-Git-Url: https://git.saurik.com/apple/xnu.git/blobdiff_plain/a991bd8d3e7fe02dbca0644054bab73c5b75324a..c3c9b80d004dbbfdf763edeb97968c6997e3b45b:/bsd/miscfs/bindfs/bind_vnops.c diff --git a/bsd/miscfs/bindfs/bind_vnops.c b/bsd/miscfs/bindfs/bind_vnops.c index 2290bd890..726337c1e 100644 --- a/bsd/miscfs/bindfs/bind_vnops.c +++ b/bsd/miscfs/bindfs/bind_vnops.c @@ -246,11 +246,10 @@ notdot: if (error == 0) { *ap->a_vpp = vp; } - } - - /* if we got lvp, drop the iocount from VNOP_LOOKUP */ - if (lvp != NULL) { - vnode_put(lvp); + /* if we got lvp, drop the iocount from VNOP_LOOKUP */ + if (lvp != NULL) { + vnode_put(lvp); + } } return error; @@ -334,7 +333,7 @@ bindfs_readdir(struct vnop_readdir_args * ap) struct dirent *dep; size_t bytesread; bufsize = 3 * MIN((user_size_t)uio_resid(uio), 87371u) / 8; - MALLOC(bufptr, void *, bufsize, M_TEMP, M_WAITOK); + bufptr = kheap_alloc(KHEAP_TEMP, bufsize, Z_WAITOK); if (bufptr == NULL) { return ENOMEM; } @@ -377,7 +376,7 @@ bindfs_readdir(struct vnop_readdir_args * ap) uio_setoffset(uio, uio_offset(auio)); } uio_free(auio); - FREE(bufptr, M_TEMP); + kheap_free(KHEAP_TEMP, bufptr, bufsize); } else { error = VNOP_READDIR(lvp, ap->a_uio, ap->a_flags, ap->a_eofflag, ap->a_numdirent, ap->a_context); vnode_put(lvp);