netlink: fix -Walloc-size

GCC 14 introduces a new -Walloc-size included in -Wextra which gives:
netlink/strset.c: In function ‘get_perdev_by_ifindex’:
netlink/strset.c:121:16: warning: allocation of insufficient size ‘1’ for type ‘struct perdev_strings’ with size ‘648’ [-Walloc-size]
  121 |         perdev = calloc(sizeof(*perdev), 1);
      |                ^

The calloc prototype is:
void *calloc(size_t nmemb, size_t size);

So, just swap the number of members and size arguments to match the prototype, as
we're initialising 1 struct of size `sizeof(*perdev)`. GCC then sees we're not
doing anything wrong. This is consistent with other use in the codebase too.

Signed-off-by: Sam James <>
Reviewed-by: Przemek Kitszel <>
1 file changed