netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vadim Fedorenko <vadim.fedorenko@linux.dev>
To: Jiri Pirko <jiri@resnulli.us>, netdev@vger.kernel.org
Cc: kuba@kernel.org, pabeni@redhat.com, davem@davemloft.net,
	edumazet@google.com, arkadiusz.kubalewski@intel.com
Subject: Re: [patch net-next] dpll: move xa_erase() call in to match dpll_pin_alloc() error path order
Date: Tue, 30 Jan 2024 21:14:49 +0000	[thread overview]
Message-ID: <c5e27a8a-739e-4b7d-a189-46b9c30361c8@linux.dev> (raw)
In-Reply-To: <20240130155814.268622-1-jiri@resnulli.us>

On 30/01/2024 15:58, Jiri Pirko wrote:
> From: Jiri Pirko <jiri@nvidia.com>
> 
> This is cosmetics. Move the call of xa_erase() in dpll_pin_put()
> so the order of cleanup calls matches the error path of
> dpll_pin_alloc().

Jiri, remind me please, why do we clean up xarray in error path in the
same order we allocate them?

The patch looks good,

Reviewed-by: Vadim Fedorenko <vadim.fedorenko@linux.dev>

> 
> Signed-off-by: Jiri Pirko <jiri@nvidia.com>
> ---
>   drivers/dpll/dpll_core.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/dpll/dpll_core.c b/drivers/dpll/dpll_core.c
> index 5152bd1b0daf..61e5c607a72f 100644
> --- a/drivers/dpll/dpll_core.c
> +++ b/drivers/dpll/dpll_core.c
> @@ -560,9 +560,9 @@ void dpll_pin_put(struct dpll_pin *pin)
>   {
>   	mutex_lock(&dpll_lock);
>   	if (refcount_dec_and_test(&pin->refcount)) {
> +		xa_erase(&dpll_pin_xa, pin->id);
>   		xa_destroy(&pin->dpll_refs);
>   		xa_destroy(&pin->parent_refs);
> -		xa_erase(&dpll_pin_xa, pin->id);
>   		dpll_pin_prop_free(&pin->prop);
>   		kfree(pin);
>   	}


  reply	other threads:[~2024-01-30 21:14 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-30 15:58 [patch net-next] dpll: move xa_erase() call in to match dpll_pin_alloc() error path order Jiri Pirko
2024-01-30 21:14 ` Vadim Fedorenko [this message]
2024-01-31  8:51   ` Jiri Pirko
2024-01-31 21:40 ` patchwork-bot+netdevbpf

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=c5e27a8a-739e-4b7d-a189-46b9c30361c8@linux.dev \
    --to=vadim.fedorenko@linux.dev \
    --cc=arkadiusz.kubalewski@intel.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=jiri@resnulli.us \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.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).