All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Julien Panis <jpanis@baylibre.com>
Cc: "David S. Miller" <davem@davemloft.net>,
	"Eric Dumazet" <edumazet@google.com>,
	"Paolo Abeni" <pabeni@redhat.com>,
	"Russell King" <linux@armlinux.org.uk>,
	"Alexei Starovoitov" <ast@kernel.org>,
	"Daniel Borkmann" <daniel@iogearbox.net>,
	"Jesper Dangaard Brouer" <hawk@kernel.org>,
	"John Fastabend" <john.fastabend@gmail.com>,
	"Sumit Semwal" <sumit.semwal@linaro.org>,
	"Christian König" <christian.koenig@amd.com>,
	"Simon Horman" <horms@kernel.org>, "Andrew Lunn" <andrew@lunn.ch>,
	"Ratheesh Kannoth" <rkannoth@marvell.com>,
	"Naveen Mamindlapalli" <naveenm@marvell.com>,
	danishanwar@ti.com, yuehaibing@huawei.com, rogerq@kernel.org,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	bpf@vger.kernel.org, linux-media@vger.kernel.org,
	dri-devel@lists.freedesktop.org, linaro-mm-sig@lists.linaro.org
Subject: Re: [PATCH net-next v8 2/3] net: ethernet: ti: Add desc_infos member to struct k3_cppi_desc_pool
Date: Tue, 9 Apr 2024 17:39:48 -0700	[thread overview]
Message-ID: <20240409173948.66abe6fa@kernel.org> (raw)
In-Reply-To: <20240223-am65-cpsw-xdp-basic-v8-2-f3421b58da09@baylibre.com>

On Mon, 08 Apr 2024 11:38:03 +0200 Julien Panis wrote:
>  		goto gen_pool_create_fail;
>  	}
>  
> +	pool->desc_infos = kcalloc(pool->num_desc,
> +				   sizeof(*pool->desc_infos), GFP_KERNEL);
> +	if (!pool->desc_infos) {
> +		ret = -ENOMEM;
> +		dev_err(pool->dev,
> +			"pool descriptor infos alloc failed %d\n", ret);

Please don't add errors on mem alloc failures. They just bloat the
kernel, there will be a rather large OOM splat in the logs if GFP_KERNEL
allocation fails.

> +		kfree_const(pool_name);
> +		goto gen_pool_desc_infos_alloc_fail;
> +	}
> +
>  	pool->gen_pool->name = pool_name;

If you add the new allocation after this line, I think you wouldn't
have to free pool_name under the if () explicitly.
-- 
pw-bot: cr

  reply	other threads:[~2024-04-10  0:39 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-08  9:38 [PATCH net-next v8 0/3] Add minimal XDP support to TI AM65 CPSW Ethernet driver Julien Panis
2024-04-08  9:38 ` [PATCH net-next v8 1/3] net: ethernet: ti: Add accessors for struct k3_cppi_desc_pool members Julien Panis
2024-04-08  9:38 ` [PATCH net-next v8 2/3] net: ethernet: ti: Add desc_infos member to struct k3_cppi_desc_pool Julien Panis
2024-04-10  0:39   ` Jakub Kicinski [this message]
2024-04-10  8:36     ` Julien Panis
2024-04-10 13:24       ` Jakub Kicinski
2024-04-08  9:38 ` [PATCH net-next v8 3/3] net: ethernet: ti: am65-cpsw: Add minimal XDP support Julien Panis
2024-04-10  0:49   ` Jakub Kicinski
2024-04-10 14:02     ` Julien Panis
2024-04-10 15:02       ` Jakub Kicinski
2024-04-12 13:56         ` Julien Panis
2024-04-09 23:51 ` [PATCH net-next v8 0/3] Add minimal XDP support to TI AM65 CPSW Ethernet driver Jacob Keller
2024-04-12 14:01   ` Julien Panis
2024-04-12 23:38     ` Keller, Jacob E

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=20240409173948.66abe6fa@kernel.org \
    --to=kuba@kernel.org \
    --cc=andrew@lunn.ch \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=christian.koenig@amd.com \
    --cc=daniel@iogearbox.net \
    --cc=danishanwar@ti.com \
    --cc=davem@davemloft.net \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=edumazet@google.com \
    --cc=hawk@kernel.org \
    --cc=horms@kernel.org \
    --cc=john.fastabend@gmail.com \
    --cc=jpanis@baylibre.com \
    --cc=linaro-mm-sig@lists.linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=naveenm@marvell.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=rkannoth@marvell.com \
    --cc=rogerq@kernel.org \
    --cc=sumit.semwal@linaro.org \
    --cc=yuehaibing@huawei.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.