keys, dns: Use kmalloc_flex to improve dns_resolver_preparse
Subsystems (2)
PATCH 1/1 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 <[email protected]>
--- net/dns_resolver/dns_key.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/dns_resolver/dns_key.c +1 -1
@@ -215,7 +215,7 @@ dns_resolver_preparse(struct key_preparsed_payload *prep)kdebug ("store result" ); prep->quotalen = result_len; - upayload =kmalloc (sizeof (*upayload) + result_len +1 ,GFP_KERNEL ); + upayload =kmalloc_flex (*upayload, data, result_len +1 );if (!upayload) {kleave (" = -ENOMEM" );return -ENOMEM ;
Signature · 2 lines
Thorsten Blum <[email protected]> GPG: 1D60 735E 8AEF 3BE4 73B6 9D84 7336 78FD 8DFE EAD4
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:
Hello:
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:
Quoted 7 lines · On Thu, 26 Feb 2026 22:49:29 +0100 you wrote:
Use
kmalloc_flex()when allocating a new 'structuser_key_payload' indns_resolver_preparse()to replace the open-coded size arithmetic.Signed-off-by Thorsten Blum <[email protected]>--- net/dns_resolver/dns_key.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Here is the summary with links:
- [net-next] keys, dns: Use kmalloc_flex to improve dns_resolver_preparse
https://git.kernel.org/netdev/net-next/c/a9a13c7379ec
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html