[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230703124427.228f7a9e@kernel.org>
Date: Mon, 3 Jul 2023 12:44:27 -0700
From: Jakub Kicinski <kuba@...nel.org>
To: leitao@...ian.org
Cc: "David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Paolo Abeni <pabeni@...hat.com>, sergey.senozhatsky@...il.com,
pmladek@...e.com, tj@...nel.or,
Dave Jones <davej@...emonkey.org.uk>,
netdev@...r.kernel.org (open list:NETWORKING DRIVERS),
linux-kernel@...r.kernel.org (open list)
Subject: Re: [PATCH] netconsole: Append kernel version to message
On Mon, 3 Jul 2023 08:41:54 -0700 leitao@...ian.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
Powered by blists - more mailing lists