public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Jiri Pirko <jiri@resnulli.us>
To: Arkadiusz Kubalewski <arkadiusz.kubalewski@intel.com>
Cc: netdev@vger.kernel.org, vadim.fedorenko@linux.dev,
	davem@davemloft.net, milena.olech@intel.com,
	linux-kernel@vger.kernel.org, pabeni@redhat.com, kuba@kernel.org,
	mschmidt@redhat.com, Jan Glaza <jan.glaza@intel.com>,
	Przemek Kitszel <przemyslaw.kitszel@intel.com>
Subject: Re: [PATCH net v5 2/4] dpll: fix pin dump crash for rebound module
Date: Thu, 18 Jan 2024 12:44:06 +0100	[thread overview]
Message-ID: <ZakPBmakH8BTv8Cz@nanopsycho> (raw)
In-Reply-To: <20240118110719.567117-3-arkadiusz.kubalewski@intel.com>

Thu, Jan 18, 2024 at 12:07:17PM CET, arkadiusz.kubalewski@intel.com wrote:

[...]

>@@ -443,7 +490,9 @@ dpll_pin_alloc(u64 clock_id, u32 pin_idx, struct module *module,
> 		ret = -EINVAL;
> 		goto err_pin_prop;
> 	}
>-	pin->prop = prop;
>+	ret = dpll_pin_prop_dup(prop, &pin->prop);
>+	if (ret)
>+		goto err_pin_prop;
> 	refcount_set(&pin->refcount, 1);
> 	xa_init_flags(&pin->dpll_refs, XA_FLAGS_ALLOC);
> 	xa_init_flags(&pin->parent_refs, XA_FLAGS_ALLOC);

You are missing dpll_pin_prop_free() call on error path. It should go
right above "err_pin_prop:" line.

Haste makes waste..

pw-bot: cr



>@@ -515,6 +564,7 @@ void dpll_pin_put(struct dpll_pin *pin)
> 		xa_destroy(&pin->dpll_refs);
> 		xa_destroy(&pin->parent_refs);
> 		xa_erase(&dpll_pin_xa, pin->id);
>+		dpll_pin_prop_free(&pin->prop);

To be symmetric with dpll_pin_alloc() order, xa_erase() should be called
first here and xa_destroys() in different order. But that is a material
for net-next.



> 		kfree(pin);
> 	}
> 	mutex_unlock(&dpll_lock);

[...]

  reply	other threads:[~2024-01-18 11:44 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-18 11:07 [PATCH net v5 0/4] dpll: fix unordered unbind/bind registerer issues Arkadiusz Kubalewski
2024-01-18 11:07 ` [PATCH net v5 1/4] dpll: fix broken error path in dpll_pin_alloc(..) Arkadiusz Kubalewski
2024-01-18 11:32   ` Jiri Pirko
2024-01-19 13:49     ` Kubalewski, Arkadiusz
2024-01-18 11:07 ` [PATCH net v5 2/4] dpll: fix pin dump crash for rebound module Arkadiusz Kubalewski
2024-01-18 11:44   ` Jiri Pirko [this message]
2024-01-19 13:49     ` Kubalewski, Arkadiusz
2024-01-18 11:07 ` [PATCH net v5 3/4] dpll: fix userspace availability of pins Arkadiusz Kubalewski
2024-01-18 11:07 ` [PATCH net v5 4/4] dpll: fix register pin with unregistered parent pin Arkadiusz Kubalewski

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=ZakPBmakH8BTv8Cz@nanopsycho \
    --to=jiri@resnulli.us \
    --cc=arkadiusz.kubalewski@intel.com \
    --cc=davem@davemloft.net \
    --cc=jan.glaza@intel.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=milena.olech@intel.com \
    --cc=mschmidt@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=przemyslaw.kitszel@intel.com \
    --cc=vadim.fedorenko@linux.dev \
    /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