From nobody Mon Jan 26 00:52:36 2026 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4dzqkr2vXKz6PMhx for ; Mon, 26 Jan 2026 00:52:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R13" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dzqkr16l5z3S5b for ; Mon, 26 Jan 2026 00:52:36 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1769388756; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qmpomY+nGJi/wZIMsoplG6WtfpSsYI2PLPyD/DHNVhM=; b=G0+ULgHsPPrUWQI7DXwm2ZjLdi+eaofcMZGgdazcTurvs+NSyr8nR4S7u6bcBINQvHcaBH 62n7Kq7YShJ5k8XldPfAw/KXr/qSxi/ztPnlIRYCyfm9k0pL/ffo7N3Gxfh98u+rYQA35k XY01zomOmgB42hQSnguzWGRW0bb68mAzTRkaZ1sQrd9z8RABLhkaBMUK9C5CLYcL3l42fo X5dtEZ2glHYtqUb4G+b6zOs9P+mgloM2mVvzCM1X5CeR3DTZf8692XDaHXGDHQaB8b+1ly ZI0NRyYh73e6yaLTdqjaG37VGAhuwVqPHztjO3ujcZS8rJZijtsCKfCiNV4a6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1769388756; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=qmpomY+nGJi/wZIMsoplG6WtfpSsYI2PLPyD/DHNVhM=; b=CCSWnysgOiJuzr6HyXRs345SJ1RCIhek3MtjDi5yq3tHexa20EvqlB/TKKQP2376gm5YdB RdE+9BRx/M9xFxEZkAvmSYyLYzB3P6XmE9uMW2O2JcY8RmfX1BpaQL+hT1UIc538YwPyuc BbjAj/nwazIOXk53urW/ZglsNqtZMC6autUPjL+qvt7y0QqtYwDS9UyaWtG2G6IlJpH7UV GZiPIPwzBSWhg6Mr4rOHXf1+SGnrq/WAF0g4IDTx6PL7j7LHM4EcoCr23pNaJ8Fkvo7Lq1 C21smFIDWxnNhwa3KLxbzM2qrLH770tBpSwa2jfPBkIcBLxJ9lLxnWO+5ZN0Ig== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1769388756; a=rsa-sha256; cv=none; b=mt2ridLjS5vK/wKbZRr/14AgKcipU6c3KLsft4e2C3FNlOoVuLEzC9rwEmuvrTDz2Ntw5M 1LsNxDTvDneKRCxEtkKPCDwxWoYLzEB6iTG0EMO4LmiRzFi8qDD/mCt2h/iy3XDZzDK8VG I5wY4Ju40Bm9funKVIvmulz9Z5jvKlBzbZ2PJcrVUJ4PxwlqxBdSS/CWTRen4ozDSjm1ew I3cyYTEbjxBp2XaPOPDesL0vTMOZSkXZpu8SThJwSPb5Hei1zkLaVitaErCmX0nfpQDKZd o9Gt6OW2WOYAt4e0q0z8Q4C/vt0Om+5NkktryFNyZJb24kiD3XywgqY5s5V7Ug== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dzqkr0kJczyk9 for ; Mon, 26 Jan 2026 00:52:36 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 47f60 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 26 Jan 2026 00:52:36 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 72dc1a15d8f7 - stable/15 - linuxkpi: Fix an error path in linux_alloc_current() List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: 72dc1a15d8f77cae2bc978a19d65145d9bf32bc7 Auto-Submitted: auto-generated Date: Mon, 26 Jan 2026 00:52:36 +0000 Message-Id: <6976bad4.47f60.20a43@gitrepo.freebsd.org> The branch stable/15 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=72dc1a15d8f77cae2bc978a19d65145d9bf32bc7 commit 72dc1a15d8f77cae2bc978a19d65145d9bf32bc7 Author: Mark Johnston AuthorDate: 2026-01-15 13:50:43 +0000 Commit: Mark Johnston 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 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); }