mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-12-24 11:34:50 +08:00
eff3860bbf
Commit66ee620f06
("idr: Permit any valid kernel pointer to be stored") changed the radix tree lookup so that it stops when reaching the bottom of the tree. However, the condition was added in the wrong place, making it possible to return retry entries to the caller. Reorder the tests to check for the retry entry before checking whether we're at the bottom of the tree. The retry entry should never be found in the tree root, so it's safe to defer the check until the end of the loop. Add a regression test to the test-suite to be sure this doesn't come back. Fixes:66ee620f06
("idr: Permit any valid kernel pointer to be stored") Reported-by: Greg Kurz <groug@kaod.org> Signed-off-by: Matthew Wilcox <willy@infradead.org>
11 lines
214 B
C
11 lines
214 B
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
#ifndef __REGRESSION_H__
|
|
#define __REGRESSION_H__
|
|
|
|
void regression1_test(void);
|
|
void regression2_test(void);
|
|
void regression3_test(void);
|
|
void regression4_test(void);
|
|
|
|
#endif
|