Merge tag 'slab-for-6.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/vbabka...
[platform/kernel/linux-rpi.git] / include / linux / compiler_types.h
index d9d98e8..74e04ec 100644 (file)
@@ -271,14 +271,16 @@ struct ftrace_likely_data {
 
 /*
  * Any place that could be marked with the "alloc_size" attribute is also
- * a place to be marked with the "malloc" attribute. Do this as part of the
- * __alloc_size macro to avoid redundant attributes and to avoid missing a
- * __malloc marking.
+ * a place to be marked with the "malloc" attribute, except those that may
+ * be performing a _reallocation_, as that may alias the existing pointer.
+ * For these, use __realloc_size().
  */
 #ifdef __alloc_size__
 # define __alloc_size(x, ...)  __alloc_size__(x, ## __VA_ARGS__) __malloc
+# define __realloc_size(x, ...)        __alloc_size__(x, ## __VA_ARGS__)
 #else
 # define __alloc_size(x, ...)  __malloc
+# define __realloc_size(x, ...)
 #endif
 
 #ifndef asm_volatile_goto