lkml.org 
[lkml]   [2023]   [Jul]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] netconsole: Append kernel version to message
On Mon,  3 Jul 2023 08:41:54 -0700 leitao@debian.org wrote:
> + uname = init_utsname()->release;
> +
> + newmsg = kasprintf(GFP_KERNEL, "%s;%s", uname, msg);
> + if (!newmsg)
> + /* In case of ENOMEM, just ignore this entry */
> + return;
> + newlen = strlen(uname) + len + 1;
> +
> + send_ext_msg_udp(nt, newmsg, newlen);
> +
> + kfree(newmsg);

You can avoid the memory allocation by putting this code into
send_ext_msg_udp(), I reckon? There's already a buffer there.
--
pw-bot: cr

\
 
 \ /
  Last update: 2023-07-03 21:44    [W:0.045 / U:0.456 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site