From nobody Thu Jan 15 14:18:56 2026 X-Original-To: dev-commits-src-main@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 4dsQ8J6XCGz6P2b2 for ; Thu, 15 Jan 2026 14:18:56 +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 4dsQ8J3gkgz4QfJ for ; Thu, 15 Jan 2026 14:18:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1768486736; 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=X24ClcjBdbp3vAPc2NjEyK05Rjq8SQXUgwRPWvr0xeo=; b=KkBvHuBAoXHLbH4Rz1z6pRaIbDoSzP1w6ViwjOdk2rwdvuKSSHMS4GplBvSRNMHZKWCsms eWoCa574aakZ1lGcqTdoUW3wlnh+aWY1EWwiDU1bVNnZB8oTevBqegGG8KV8o4dL15zcgr SaFtV4lCbnR+vpfO1lHyCbn3D0wVEeDuh+x6Gux/7eXkGBbN5XDnpA2bc7Caitd0nFhemo w6g7tlUxYdN21udZJkYUQwYdqasYl2Md6xYcQkrWxdTUjk56/aHVAzNLZYJNNu5KYYVyvF 9ZPCIlOgU3XNbi316W7hoWV7TTiYXWZA5AyFrxvtLEwgsd4Nyhzdomj91BM5pw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1768486736; 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=X24ClcjBdbp3vAPc2NjEyK05Rjq8SQXUgwRPWvr0xeo=; b=AIZ0aEKyQI89+03TYRSQLr27YABgWt1uLkgF8QCwmA4bCSw3/xmDkVPnAdr8ql4+mdkNct OgpyhqrQHQj/79r6yOgDyn9jcnIbjV0Pgp1TTUVADCxpTJPf3AgQEQUrdxRYfjlHXsPGpN 3PtPfTrtfHBhL5umzkV4+zC1j6EDHzdAIabYlawiaFWalw34DK0Hqkxpv6bBa5hwnErCuj k87l95aNUG3N5sKfbczhgQfTcQVwUZo3GcvINPmz6sXR9uFfeXjjW9JlhMXwJElJ3uWtxo AVeg9um6N/P4P2DYsjQlQKkg3XqDCTeofRByxRXi8Y+Vwy+rU60I+G2nw+Ogow== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1768486736; a=rsa-sha256; cv=none; b=Y5YP2sFuIHGuOpKtCDN0FozwDZQMCZz5wbwDPzn/8eCm0vGK5oFwTZjp26aWn85gz1z3Vg lni+EXRPXTlY97pmOFFG0gzSFY5Mm6T/BnrgQiL9MiRPJ/ZirzECMRHhghdrxB/ryV9X6+ U1v8oxSSryE0wq+cjy2Gus8yeuFwSg6gayzOaXTIrpT411zpcZLjpuB5SPlb2wlJt2YoU3 siivyrCd3ABUMvcpXW+XNt94agXcXdcCZTsJKSqztvB5l+CUjA3C89e3f4f+6IHXkhIXXT 0r30oieInQbqygUFxgQILEDgAus6ilPTCNLie662e/kgK0l5NN0ZFV6sKa/HNQ== 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 4dsQ8J31tMzXWf for ; Thu, 15 Jan 2026 14:18:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id e64a by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 15 Jan 2026 14:18:56 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: a4955b014336 - main - linuxkpi: Fix an error path in linux_alloc_current() List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: a4955b0143361900140df640d116891f047f5431 Auto-Submitted: auto-generated Date: Thu, 15 Jan 2026 14:18:56 +0000 Message-Id: <6968f750.e64a.5fcfff58@gitrepo.freebsd.org> The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=a4955b0143361900140df640d116891f047f5431 commit a4955b0143361900140df640d116891f047f5431 Author: Mark Johnston AuthorDate: 2026-01-15 13:50:43 +0000 Commit: Mark Johnston CommitDate: 2026-01-15 13:50:43 +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 --- 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); }