Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796089256; b=AemJIw+yanSKe+2GTIP3LvHgnhLQxj/UyL7K/N3YV/fBDGRdtRMQK6Yi9cBNPXZXlpIN Oq1hL0qWuHnAWiYeUjMcxJ7Hdi6xgVKQeg+rh1IYnu4ydDjc+xIctCfT4ta0mfc04QE+L sHkZcYJeI5Tl+8SvvQcu2+LX53bFmf1ffQ/ST62vs+KOpVmDp3bZVjeGmIkRMeqoTITfJ MKDfYiH+VqmnrF3HUPUcZqN5mXGKFj7lRH+nQ+LD+FE1tNxPDFaWcSLFbqpZBd5BmdowE fdzBOtVbcOi/sF+2urczEPhNhuWI8v9e8gE1Vk30dcETlXj5/wyUldEyS/x1EKpjl9g== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796089256; h=Received:DKIM-Signature:Date:To:From:In-Reply-To:References:Subject: Message-Id; bh=kkzh5bvjkItMwzbnVFRU9wqTWgvc+LvP/oUDdelltfI=; b=iZr5WX5wV3Z6tD0Um6w3ifJoqRZVliseq+F4ka6zyVSlNub8V3VTGoF+E6Ps1I9ahYPR zYj35j3NIKBp4iN7edflT+iay2QYb2gvt3PLPnwBZKAh0V+XL+dj6r3HQ+g5Ifi1Tk9bm DcIhwQtsI2LW8Jjuy9l/fWoLp7usqXWPLxnX++eV8YGxbNfH9hZ2pM9QJ2qz1Jm4sFMbX gR9IqxMR/4lH4wmQEv/U4ycYmkPUSk9HUSsbsmVAJ25NhWxn8YuU8pqwXaHiVSpBIV6sx wvdBeXa2hcTBzkvMeHkVOvu9nkFmnM/ded1vJgUvDyH82FE3COoiCdvP6sjfjiaP+9g== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linux-foundation.org header.i=@linux-foundation.org header.a=rsa-sha256 header.s=korg header.b=EJ1YbtQI; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8044B606A31A for ; Tue, 1 Dec 2026 01:40:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.a=rsa-sha256 header.s=korg header.b=EJ1YbtQI Received: by smtp.kernel.org (Postfix) with ESMTPSA id EEF151F00893; Tue, 1 Dec 2026 01:40:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=korg; t=1796089256; bh=kkzh5bvjkItMwzbnVFRU9wqTWgvc+LvP/oUDdelltfI=; h=Date:To:From:In-Reply-To:References:Subject; b=EJ1YbtQIFfQIy3TNz6bwbqt30nWY9cP1L5H9qHh2j1mdFWYw7JNg2iCcagNoUNXAV ajrh1nYHQU7jq+sFWJxTGDRDbIwDyMUODi+dGMR0YTcsgVGM/pb7zSM+iM5Q3mGIXD AfcSP63orhytoEDJjZs/T/SWuTtmcUI5eaCXnClQ= Date: Mon, 30 Nov 2026 17:40:55 -0800 To: mm-commits@vger.kernel.org,simona.vetter@ffwll.ch,paulmck@kernel.org, nilay@linux.ibm.com,elver@google.com,ecree@solarflare.com, dhowells@redhat.com,david@davidgow.net,corbet@lwn.net, andriy.shevchenko@linux.intel.com,ajordanr@google.com,zhangcoder@yeah.net, akpm@linux-foundation.org From: Andrew Morton In-Reply-To: <20261130032224.15372-2-zhangcoder@yeah.net> References: <20261130032224.15372-2-zhangcoder@yeah.net> Subject: + list-add-missing-empty-list-check-to-list_cut_before.patch added to mm-nonmm-unstable branch Message-Id: <20261201014055.EEF151F00893@smtp.kernel.org> X-Mailing-List: mm-commits@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list The patch titled Subject: list: add missing empty list check to list_cut_before() has been added to the -mm mm-nonmm-unstable branch. Its filename is list-add-missing-empty-list-check-to-list_cut_before.patch This patch will shortly appear at https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/list-add-missing-empty-list-check-to-list_cut_before.patch This patch will later appear in the mm-nonmm-unstable branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next via various branches at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm and is updated there most days ------------------------------------------------------ From: Ziran Zhang Subject: list: add missing empty list check to list_cut_before() Date: Mon, 30 Nov 2026 11:22:23 +0800 Patch series "list: add missing empty list check to list_cut_before()", v4. Patch 1 adds the missing list_empty() guard; patch 2 adds a KUnit test case. This patch (of 2): list_cut_before() lacks the list_empty() guard present in list_cut_position(). With an empty head, the function falls through to the pointer updates instead of returning early. Both helpers share the same kernel-doc wording: 'You should pass on @entry an element you know is on @head.' Nevertheless, list_cut_position() returns early for an empty head, and list_splice() also checks its source list before doing any pointer updates. Make list_cut_before() consistent with them for the empty-list case. Link: https://lore.kernel.org/20261130032224.15372-1-zhangcoder@yeah.net Link: https://patch.msgid.link/20261130032224.15372-2-zhangcoder@yeah.net Signed-off-by: Ziran Zhang Signed-off-by: Andrew Morton Reviewed-by: Andy Shevchenko Cc: David Gow Cc: Paul E. McKenney Cc: David Howells Cc: Jonathan Corbet Cc: Jordan R Abrahams-Whitehead Cc: Marco Elver Cc: Nilay Shroff Cc: Edward Cree Cc: Simona Vetter include/linux/list.h | 5 +++++ 1 file changed, 5 insertions(+) --- a/include/linux/list.h~list-add-missing-empty-list-check-to-list_cut_before +++ a/include/linux/list.h @@ -555,6 +555,11 @@ static inline void list_cut_before(struc struct list_head *head, struct list_head *entry) { + if (list_empty(head)) { + INIT_LIST_HEAD(list); + return; + } + if (head->next == entry) { INIT_LIST_HEAD(list); return; _ Patches currently in -mm which might be from zhangcoder@yeah.net are include-linux-jhashh-fix-kernel-doc-parameter-name.patch list-add-missing-empty-list-check-to-list_cut_before.patch list-add-kunit-test-for-list_cut_before-empty-list-case.patch