netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Alex Elder <elder@linaro.org>
Cc: davem@davemloft.net, edumazet@google.com, pabeni@redhat.com,
	mka@chromium.org, evgreen@chromium.org, andersson@kernel.org,
	quic_cpratapa@quicinc.com, quic_avuyyuru@quicinc.com,
	quic_jponduru@quicinc.com, quic_subashab@quicinc.com,
	elder@kernel.org, netdev@vger.kernel.org,
	linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next 9/9] net: ipa: use a bitmap for enabled endpoints
Date: Tue, 1 Nov 2022 21:34:04 -0700	[thread overview]
Message-ID: <20221101213404.3e4c3b8f@kernel.org> (raw)
In-Reply-To: <20221030001828.754010-10-elder@linaro.org>

On Sat, 29 Oct 2022 19:18:28 -0500 Alex Elder wrote:
>  	/* Set up the defined endpoint bitmap */
>  	ipa->defined = bitmap_zalloc(ipa->endpoint_count, GFP_KERNEL);
>  	ipa->set_up = bitmap_zalloc(ipa->endpoint_count, GFP_KERNEL);
> +	ipa->enabled = bitmap_zalloc(ipa->endpoint_count, GFP_KERNEL);
>  	if (!ipa->defined || !ipa->set_up) {

This condition should now check if ipa->enabled

And the error handling patch needs to free it, in case it was something
else that didn't get allocated?

Frankly I have gotten mass-NULL-checks wrong more than once myself so
I'd steer clear of those, they are strangely error prone.

>  		dev_err(dev, "unable to allocate endpoint bitmaps\n");

this error message should not be here (patch 5 adds it I think)
memory allocation failures produce a splat, no need to print errors

> +		bitmap_free(ipa->set_up);
> +		ipa->set_up = NULL;
>  		bitmap_free(ipa->defined);

  reply	other threads:[~2022-11-02  4:34 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-30  0:18 [PATCH net-next 0/9] net: ipa: support more endpoints Alex Elder
2022-10-30  0:18 ` [PATCH net-next 1/9] net: ipa: reduce arguments to ipa_table_init_add() Alex Elder
2022-10-30  0:18 ` [PATCH net-next 2/9] net: ipa: use ipa_table_mem() in ipa_table_reset_add() Alex Elder
2022-10-30  0:18 ` [PATCH net-next 3/9] net: ipa: add a parameter to aggregation registers Alex Elder
2022-10-30  0:18 ` [PATCH net-next 4/9] net: ipa: add a parameter to suspend registers Alex Elder
2022-10-30  0:18 ` [PATCH net-next 5/9] net: ipa: use a bitmap for defined endpoints Alex Elder
2022-10-30  0:18 ` [PATCH net-next 6/9] net: ipa: use a bitmap for available endpoints Alex Elder
2022-10-30  0:18 ` [PATCH net-next 7/9] net: ipa: support more filtering endpoints Alex Elder
2022-10-30  0:18 ` [PATCH net-next 8/9] net: ipa: use a bitmap for set-up endpoints Alex Elder
2022-10-30  0:18 ` [PATCH net-next 9/9] net: ipa: use a bitmap for enabled endpoints Alex Elder
2022-11-02  4:34   ` Jakub Kicinski [this message]
2022-11-02 12:44     ` Alex Elder

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=20221101213404.3e4c3b8f@kernel.org \
    --to=kuba@kernel.org \
    --cc=andersson@kernel.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=elder@kernel.org \
    --cc=elder@linaro.org \
    --cc=evgreen@chromium.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mka@chromium.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=quic_avuyyuru@quicinc.com \
    --cc=quic_cpratapa@quicinc.com \
    --cc=quic_jponduru@quicinc.com \
    --cc=quic_subashab@quicinc.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 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).