[PATCH v4 0/2] list: add missing empty list check to list_cut_before()
From: Ziran Zhang
Date: Sun Nov 29 2026 - 22:24:24 EST
Patch 1 adds the missing list_empty() guard; patch 2 adds a KUnit
test case.
v4:
- Add Reviewed-by from Andy Shevchenko to patch 1/2.
- Add Acked-by from David Gow to patch 2/2.
v3:
- Elaborate the rationale in the commit message, as requested
by Andy Shevchenko.
- Add Reviewed-by from Andy Shevchenko to patch 2/2.
v2:
- Add a KUnit test case as requested by Andy Shevchenko.
- Patch 1 adds the missing list_empty() guard, patch 2 adds the
test case.
v1:
- https://lore.kernel.org/all/20260916100001.10634-1-zhangcoder@xxxxxxxx/
Tested with:
tools/testing/kunit/kunit.py run --kernel_args=kunit.filter_glob='list-kunit-test'
Test result:
[PASSED] list_test_list_cut_before_empty
Testing complete. Ran 40 tests: passed: 40
Ziran Zhang (2):
list: add missing empty list check to list_cut_before()
list: add KUnit test for list_cut_before() empty list case
include/linux/list.h | 5 +++++
lib/tests/list-test.c | 18 ++++++++++++++++++
2 files changed, 23 insertions(+)
--
2.51.0