Date: Mon, 7 Aug 2023 14:24:16 GMT From: Dmitry Chagin <dchagin@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Subject: git: 7027716f9d8d - stable/13 - linux(4): Use M_LINUX for malloc type in readdir Message-ID: <202308071424.377EOGot025848@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=7027716f9d8d2877df78efa033cdb0249db44aba commit 7027716f9d8d2877df78efa033cdb0249db44aba Author: Dmitry Chagin <dchagin@FreeBSD.org> AuthorDate: 2023-07-18 21:44:15 +0000 Commit: Dmitry Chagin <dchagin@FreeBSD.org> CommitDate: 2023-08-07 14:22:58 +0000 linux(4): Use M_LINUX for malloc type in readdir MFC after: 2 weeks (cherry picked from commit 13d049ab8dd718d0723229d54062c91b2fc68fda) --- sys/compat/linux/linux_file.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/compat/linux/linux_file.c b/sys/compat/linux/linux_file.c index 3e1b5299cf0b..249034231c36 100644 --- a/sys/compat/linux/linux_file.c +++ b/sys/compat/linux/linux_file.c @@ -603,7 +603,7 @@ linux_readdir(struct thread *td, struct linux_readdir_args *args) int buflen, error; buflen = sizeof(*bdp); - buf = malloc(buflen, M_TEMP, M_WAITOK); + buf = malloc(buflen, M_LINUX, M_WAITOK); error = kern_getdirentries(td, args->fd, buf, buflen, &base, NULL, UIO_SYSSPACE); @@ -614,7 +614,7 @@ linux_readdir(struct thread *td, struct linux_readdir_args *args) if (td->td_retval[0] == 0) goto out; - linux_dirent = malloc(LINUX_RECLEN(LINUX_NAME_MAX), M_TEMP, + linux_dirent = malloc(LINUX_RECLEN(LINUX_NAME_MAX), M_LINUX, M_WAITOK | M_ZERO); bdp = (struct dirent *) buf; @@ -629,9 +629,9 @@ linux_readdir(struct thread *td, struct linux_readdir_args *args) if (error == 0) td->td_retval[0] = linuxreclen; - free(linux_dirent, M_TEMP); + free(linux_dirent, M_LINUX); out: - free(buf, M_TEMP); + free(buf, M_LINUX); return (error); } #endif /* __i386__ || (__amd64__ && COMPAT_LINUX32) */
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202308071424.377EOGot025848>