Subject: Re: [PATCH] netconsole: Append kernel version to message

From: Jakub Kicinski <[email-masked]>
Date: Mon, 3 Jul 2023 12:44:27 -0700

On Mon,  3 Jul 2023 08:41:54 -0700 [email-masked] 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