Date: Mon, 26 Jan 2026 00:52:36 +0000 From: Mark Johnston <markj@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Subject: git: 72dc1a15d8f7 - stable/15 - linuxkpi: Fix an error path in linux_alloc_current() Message-ID: <6976bad4.47f60.20a43@gitrepo.freebsd.org>
index | next in thread | raw e-mail
The branch stable/15 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=72dc1a15d8f77cae2bc978a19d65145d9bf32bc7 commit 72dc1a15d8f77cae2bc978a19d65145d9bf32bc7 Author: Mark Johnston <markj@FreeBSD.org> AuthorDate: 2026-01-15 13:50:43 +0000 Commit: Mark Johnston <markj@FreeBSD.org> CommitDate: 2026-01-26 00:51:44 +0000 linuxkpi: Fix an error path in linux_alloc_current() If the allocation fails we should free the task struct. While here get rid of a couple of unnecessary assertions. Reported by: Kevin Day <kevin@your.org> Reviewed by: emaste MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D54671 (cherry picked from commit a4955b0143361900140df640d116891f047f5431) --- sys/compat/linuxkpi/common/src/linux_current.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/sys/compat/linuxkpi/common/src/linux_current.c b/sys/compat/linuxkpi/common/src/linux_current.c index c342eb279caa..3bc5d31d211a 100644 --- a/sys/compat/linuxkpi/common/src/linux_current.c +++ b/sys/compat/linuxkpi/common/src/linux_current.c @@ -90,11 +90,8 @@ linux_alloc_current(struct thread *td, int flags) } ts = uma_zalloc(linux_current_zone, flags | M_ZERO); - if (ts == NULL) { - if ((flags & (M_WAITOK | M_NOWAIT)) == M_WAITOK) - panic("linux_alloc_current: failed to allocate task"); + if (ts == NULL) return (ENOMEM); - } mm = NULL; /* setup new task structure */ @@ -118,10 +115,7 @@ linux_alloc_current(struct thread *td, int flags) PROC_UNLOCK(proc); mm = uma_zalloc(linux_mm_zone, flags | M_ZERO); if (mm == NULL) { - if ((flags & (M_WAITOK | M_NOWAIT)) == M_WAITOK) - panic( - "linux_alloc_current: failed to allocate mm"); - uma_zfree(linux_current_zone, mm); + uma_zfree(linux_current_zone, ts); return (ENOMEM); }home | help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?6976bad4.47f60.20a43>
