summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/linux/overflow.h2
-rw-r--r--include/linux/slab.h6
2 files changed, 2 insertions, 6 deletions
diff --git a/include/linux/overflow.h b/include/linux/overflow.h
index a5e95dbce220..eddd987a8513 100644
--- a/include/linux/overflow.h
+++ b/include/linux/overflow.h
@@ -570,7 +570,7 @@ static inline size_t __must_check size_sub(size_t minuend, size_t subtrahend)
* @FAM is not annotated with __counted_by(), always returns true.
*/
#define overflows_flex_counter_type(TYPE, FAM, COUNT) \
- (!overflows_type(COUNT, typeof_flex_counter(((TYPE *)NULL)->FAM)))
+ (overflows_type(COUNT, typeof_flex_counter(((TYPE *)NULL)->FAM)))
/**
* __set_flex_counter() - Set the counter associated with the given flexible
diff --git a/include/linux/slab.h b/include/linux/slab.h
index c5fde8740281..1270320b59c8 100644
--- a/include/linux/slab.h
+++ b/include/linux/slab.h
@@ -1003,11 +1003,7 @@ void *kmalloc_nolock_noprof(size_t size, gfp_t gfp_flags, int node);
({ \
const size_t __count = (COUNT); \
const size_t __obj_size = struct_size_t(TYPE, FAM, __count); \
- TYPE *__obj_ptr; \
- if (WARN_ON_ONCE(overflows_flex_counter_type(TYPE, FAM, __count))) \
- __obj_ptr = NULL; \
- else \
- __obj_ptr = KMALLOC(__obj_size, GFP); \
+ TYPE *__obj_ptr = KMALLOC(__obj_size, GFP); \
if (__obj_ptr) \
__set_flex_counter(__obj_ptr->FAM, __count); \
__obj_ptr; \