git: fffb2e8de691 - main - linux(4): Delete a useless variable in readdir
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 18 Jul 2023 21:44:55 UTC
The branch main has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=fffb2e8de691ba6677616f7e0e5c442f4e7e722a commit fffb2e8de691ba6677616f7e0e5c442f4e7e722a 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): Delete a useless variable in readdir MFC after: 2 weeks --- sys/compat/linux/linux_file.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/sys/compat/linux/linux_file.c b/sys/compat/linux/linux_file.c index a5b8a4270dc0..951ea852ae44 100644 --- a/sys/compat/linux/linux_file.c +++ b/sys/compat/linux/linux_file.c @@ -555,9 +555,8 @@ linux_readdir(struct thread *td, struct linux_readdir_args *args) struct dirent *bdp; caddr_t buf; /* BSD-format */ int linuxreclen; /* Linux-format */ - caddr_t lbuf; /* Linux-format */ off_t base; - struct l_dirent *linux_dirent; + struct l_dirent *linux_dirent; /* Linux-format */ int buflen, error; buflen = sizeof(*bdp); @@ -572,12 +571,12 @@ linux_readdir(struct thread *td, struct linux_readdir_args *args) if (td->td_retval[0] == 0) goto out; - lbuf = malloc(LINUX_RECLEN(LINUX_NAME_MAX), M_TEMP, M_WAITOK | M_ZERO); + linux_dirent = malloc(LINUX_RECLEN(LINUX_NAME_MAX), M_TEMP, + M_WAITOK | M_ZERO); bdp = (struct dirent *) buf; linuxreclen = LINUX_RECLEN(bdp->d_namlen); - linux_dirent = (struct l_dirent*)lbuf; linux_dirent->d_ino = bdp->d_fileno; linux_dirent->d_off = bdp->d_off; linux_dirent->d_reclen = bdp->d_namlen; @@ -587,7 +586,7 @@ linux_readdir(struct thread *td, struct linux_readdir_args *args) if (error == 0) td->td_retval[0] = linuxreclen; - free(lbuf, M_TEMP); + free(linux_dirent, M_TEMP); out: free(buf, M_TEMP); return (error);