Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp26682447rwd; Mon, 3 Jul 2023 13:18:06 -0700 (PDT) X-Google-Smtp-Source: APBJJlF5pCZc5QbclAnyqnDbwqgX1pdT5+SyAjnZAAkbNQBgDTR9uV6ay2WrcqtX7bt2k7ORscxB X-Received: by 2002:a17:902:e745:b0:1b8:95fc:d10 with SMTP id p5-20020a170902e74500b001b895fc0d10mr4679455plf.21.1688415485904; Mon, 03 Jul 2023 13:18:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688415485; cv=none; d=google.com; s=arc-20160816; b=I5kanUSynJE4N2lcyjJtUZNLulo/ATe/TVE6FvE2FaeSTrsG4ksm3B3PnkxO4+Vd4h oRSMw0zC794YELhhbQZp0OTn1wixzPExXkDhEIFRy4Mv/w5c6ZwgFy0JCPmw4ucnhlSz Jz5H8lRZMRLL996wUs4jCRk08cEpBoyUD/7pIIO/EIKhrP3l14r5ikiGtHZrZLfFM0c0 O6HzkM1wfg52zO9T+mUYmCkzcj7sYWG8lsDy2SfyANDXy/sEEXPgGKyZFjw5CtHmR1xg caOBMPBLrB9KDvxNoVyGXm4pYPOLju5F61OxwKEKJDPDuvrj7XkDLjwD5tt28zSJ2gD/ 0oIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=+QYGIGe0qLKAcMN1KlCgNhWMF9cGZ+GCA9RXhr96M9I=; fh=KlpY9zCrn3BQwJjT5L1l2fHvNl3vgLRhBen3n8GZyug=; b=JR551wDZh8pjt3mMKI2tCwTbfjdg90I7AWvgA4ymepSnkJfEeMNQ2yjAFL9qxE0Oj5 NROebEZAp+RYTKWPRkrRGFQBbbfWziXVA4t/nkWe5kL24JTJW2TRfKy9cSGhnbhoEnNJ 1V+vEmti8tE5cMK3TQ7U4PHImVdr/wqZuFwa7TfoFsYsGf76XDQpFoNQHW4NmGWrJREC bDdML4VvL8rDfBheQq2XWOJ2qKM/FfeV5hQMGSJlvzA9cVc6AOzWCVOp7YLC+V9MQEg1 NWEWvN6dWC2w+L3vGk2r3R8l8J1ZU5615eJIE5l0DVtOFdDK/R41E0xfMC+gxyv+UEqK 21xQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=fyYi2eww; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z9-20020a170903018900b001b8918da8cdsi3847083plg.205.2023.07.03.13.17.52; Mon, 03 Jul 2023 13:18:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=fyYi2eww; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231443AbjGCToa (ORCPT + 99 others); Mon, 3 Jul 2023 15:44:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52956 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230451AbjGCTo3 (ORCPT ); Mon, 3 Jul 2023 15:44:29 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4DC0BE69 for ; Mon, 3 Jul 2023 12:44:29 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id E033A61022 for ; Mon, 3 Jul 2023 19:44:28 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EF5F9C433C7; Mon, 3 Jul 2023 19:44:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1688413468; bh=JhZb50vovyTnsLJREDIpXMbd3ET0Yiy5SJpuD7Hpuzo=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=fyYi2ewwMB5oM4c2XuxPDW769rz8FoMqEAXWFv0RHga4P7/zGbWzhBx/DubmJ090q btmsEQyWKNnJPwyWP2SNNoBZle+lBO+8mSQwsynjbU38tlE1qwEHHJvp9PXcYH0n2W fns1Qp5NpZq7LtAuc1mJZfafrIgMfKR4O4wa8USG3wnK+Ii8iyb/7WOUrCfG5/EOTD usf6jQKU86toUKUlf8wcqwNFyR+udfuYDylrlwB66iU3hD9hOd/zl16UrrdbBEzUsc yTp5lsVPQBFGLC/18U6i0cFvFvud7cmRmAoNYHp1D5tpkTxH23kEc779xuN6S3KRuA BWsfmG1FCQipA== Date: Mon, 3 Jul 2023 12:44:27 -0700 From: Jakub Kicinski To: leitao@debian.org Cc: "David S. Miller" , Eric Dumazet , Paolo Abeni , sergey.senozhatsky@gmail.com, pmladek@suse.com, tj@kernel.or, Dave Jones , netdev@vger.kernel.org (open list:NETWORKING DRIVERS), linux-kernel@vger.kernel.org (open list) Subject: Re: [PATCH] netconsole: Append kernel version to message Message-ID: <20230703124427.228f7a9e@kernel.org> In-Reply-To: <20230703154155.3460313-1-leitao@debian.org> References: <20230703154155.3460313-1-leitao@debian.org> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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