Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

keys, dns: Use kmalloc_flex to improve dns_resolver_preparse

Use kmalloc_flex() when allocating a new 'struct user_key_payload' in
dns_resolver_preparse() to replace the open-coded size arithmetic.

Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
Link: https://patch.msgid.link/20260226214930.785423-3-thorsten.blum@linux.dev
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Thorsten Blum and committed by
Jakub Kicinski
a9a13c73 58e443b7

+1 -1
+1 -1
net/dns_resolver/dns_key.c
··· 215 215 kdebug("store result"); 216 216 prep->quotalen = result_len; 217 217 218 - upayload = kmalloc(sizeof(*upayload) + result_len + 1, GFP_KERNEL); 218 + upayload = kmalloc_flex(*upayload, data, result_len + 1); 219 219 if (!upayload) { 220 220 kleave(" = -ENOMEM"); 221 221 return -ENOMEM;