git: 13d049ab8dd7 - main - linux(4): Use M_LINUX for malloc type in readdir

From: Dmitry Chagin <dchagin_at_FreeBSD.org>
Date: Tue, 18 Jul 2023 21:44:56 UTC
The branch main has been updated by dchagin:

URL: https://cgit.FreeBSD.org/src/commit/?id=13d049ab8dd718d0723229d54062c91b2fc68fda

commit 13d049ab8dd718d0723229d54062c91b2fc68fda
Author:     Dmitry Chagin <dchagin@FreeBSD.org>
AuthorDate: 2023-07-18 21:44:15 +0000
Commit:     Dmitry Chagin <dchagin@FreeBSD.org>
CommitDate: 2023-07-18 21:44:15 +0000

    linux(4): Use M_LINUX for malloc type in readdir
    
    MFC after:              2 weeks
---
 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 951ea852ae44..37a06dd81c67 100644
--- a/sys/compat/linux/linux_file.c
+++ b/sys/compat/linux/linux_file.c
@@ -560,7 +560,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);
@@ -571,7 +571,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;
@@ -586,9 +586,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) */