netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: leitao@debian.org
Cc: "David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Paolo Abeni <pabeni@redhat.com>,
	sergey.senozhatsky@gmail.com, pmladek@suse.com, tj@kernel.or,
	Dave Jones <davej@codemonkey.org.uk>,
	netdev@vger.kernel.org (open list:NETWORKING DRIVERS),
	linux-kernel@vger.kernel.org (open list)
Subject: Re: [PATCH] netconsole: Append kernel version to message
Date: Mon, 3 Jul 2023 12:44:27 -0700	[thread overview]
Message-ID: <20230703124427.228f7a9e@kernel.org> (raw)
In-Reply-To: <20230703154155.3460313-1-leitao@debian.org>

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

  parent reply	other threads:[~2023-07-03 19:44 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-03 15:41 [PATCH] netconsole: Append kernel version to message leitao
2023-07-03 16:46 ` Andrew Lunn
2023-07-04 15:53   ` Breno Leitao
2023-07-03 18:34 ` Stephen Hemminger
2023-07-04 15:15   ` Breno Leitao
2023-07-04 15:58     ` Stephen Hemminger
2023-07-05  9:18       ` Breno Leitao
2023-07-05 15:26         ` Stephen Hemminger
2023-07-05 15:49           ` Jakub Kicinski
2023-07-03 19:44 ` Jakub Kicinski [this message]
2023-07-04 15:47   ` Breno Leitao
2023-07-05 15:56     ` Jakub Kicinski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230703124427.228f7a9e@kernel.org \
    --to=kuba@kernel.org \
    --cc=davej@codemonkey.org.uk \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=leitao@debian.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=pmladek@suse.com \
    --cc=sergey.senozhatsky@gmail.com \
    --cc=tj@kernel.or \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).