Files
linux/include/linux
Jean-Philippe Brucker 0ee1472547 mm/util: Swap kmemdup_array() arguments
GCC 14.1 complains about the argument usage of kmemdup_array():

  drivers/soc/tegra/fuse/fuse-tegra.c:130:65: error: 'kmemdup_array' sizes specified with 'sizeof' in the earlier argument and not in the later argument [-Werror=calloc-transposed-args]
    130 |         fuse->lookups = kmemdup_array(fuse->soc->lookups, sizeof(*fuse->lookups),
        |                                                                 ^
  drivers/soc/tegra/fuse/fuse-tegra.c:130:65: note: earlier argument should specify number of elements, later size of each element

The annotation introduced by commit 7d78a77733 ("string: Add
additional __realloc_size() annotations for "dup" helpers") lets the
compiler think that kmemdup_array() follows the same format as calloc(),
with the number of elements preceding the size of one element. So we
could simply swap the arguments to __realloc_size() to get rid of that
warning, but it seems cleaner to instead have kmemdup_array() follow the
same format as krealloc_array(), memdup_array_user(), calloc() etc.

Fixes: 7d78a77733 ("string: Add additional __realloc_size() annotations for "dup" helpers")
Signed-off-by: Jean-Philippe Brucker <jean-philippe@linaro.org>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20240606144608.97817-2-jean-philippe@linaro.org
Signed-off-by: Kees Cook <kees@kernel.org>
2024-06-06 08:55:20 -07:00
..
2024-03-19 16:11:42 +01:00
2024-04-24 11:06:26 -07:00
2024-04-25 20:55:49 -07:00
2024-05-02 20:35:57 +02:00
2024-04-17 08:44:03 -06:00
2024-03-11 15:37:23 -07:00
2024-04-29 16:28:07 -07:00
2024-05-08 17:29:22 -04:00
2024-04-23 09:03:37 +09:00
2024-05-05 17:53:55 -07:00
2024-03-12 23:08:29 -07:00
2024-05-11 00:41:15 +00:00
2024-04-15 16:03:24 -04:00
2024-05-09 13:02:39 +02:00
2024-05-19 14:36:17 -07:00
2024-05-22 16:12:48 -07:00
2024-05-19 14:40:44 -07:00
2024-05-05 17:53:53 -07:00
2024-04-23 13:16:03 +02:00
2024-03-10 14:38:04 -07:00
2024-05-03 10:44:42 +01:00
2024-04-15 14:31:48 +02:00
2024-03-09 09:14:50 -05:00
2024-05-05 17:53:49 -07:00
2024-05-05 17:53:50 -07:00
2024-03-26 11:07:20 -07:00
2024-05-16 18:14:14 -05:00
2024-03-13 12:53:53 -07:00
2024-03-13 12:53:53 -07:00
2024-04-17 13:14:30 +02:00
2024-04-15 19:43:48 +02:00
2024-04-02 18:03:32 -07:00
2024-03-08 12:05:10 +01:00
2024-04-03 09:59:38 +01:00
2024-05-02 16:28:15 +02:00
2024-04-09 10:53:44 +02:00
2024-03-26 09:01:18 +01:00
2024-05-04 18:57:21 +02:00
2024-05-23 19:40:26 -07:00
2024-04-08 11:49:02 +01:00
2024-05-06 12:05:00 +02:00
2024-04-07 02:42:36 -04:00
2024-04-25 20:55:48 -07:00