projects
/
platform
/
kernel
/
linux-rpi.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
490645d
)
IDR test suite: Check handling negative end correctly
author
Matthew Wilcox
<mawilcox@microsoft.com>
Tue, 28 Nov 2017 19:27:14 +0000
(14:27 -0500)
committer
Matthew Wilcox
<mawilcox@microsoft.com>
Tue, 6 Feb 2018 20:07:20 +0000
(15:07 -0500)
One of the charming quirks of the idr_alloc() interface is that you
can pass a negative end and it will be interpreted as "maximum". Ensure
we don't break that.
Signed-off-by: Matthew Wilcox <mawilcox@microsoft.com>
tools/testing/radix-tree/idr-test.c
patch
|
blob
|
history
diff --git
a/tools/testing/radix-tree/idr-test.c
b/tools/testing/radix-tree/idr-test.c
index
193450b
..
892ef88
100644
(file)
--- a/
tools/testing/radix-tree/idr-test.c
+++ b/
tools/testing/radix-tree/idr-test.c
@@
-207,6
+207,7
@@
void idr_checks(void)
assert(idr_alloc(&idr, item, i, i + 10, GFP_KERNEL) == i);
}
assert(idr_alloc(&idr, DUMMY_PTR, i - 2, i, GFP_KERNEL) == -ENOSPC);
+ assert(idr_alloc(&idr, DUMMY_PTR, i - 2, i + 10, GFP_KERNEL) == -ENOSPC);
idr_for_each(&idr, item_idr_free, &idr);
idr_destroy(&idr);