public inbox for stable@vger.kernel.org
 help / color / mirror / Atom feed
From: Przemek Kitszel <przemyslaw.kitszel@intel.com>
To: Jiasheng Jiang <jiashengjiangcool@gmail.com>
Cc: <arkadiusz.kubalewski@intel.com>, <jiri@resnulli.us>,
	<davem@davemloft.net>, <jan.glaza@intel.com>,
	<linux-kernel@vger.kernel.org>, <netdev@vger.kernel.org>,
	<stable@vger.kernel.org>, <vadim.fedorenko@linux.dev>
Subject: Re: [PATCH v3 net-next] dpll: Add an assertion to check freq_supported_num
Date: Thu, 27 Feb 2025 06:21:08 +0100	[thread overview]
Message-ID: <34b2c92f-e879-4a9e-beb6-c6786bd59c9d@intel.com> (raw)
In-Reply-To: <20250226193715.23898-1-jiashengjiangcool@gmail.com>

On 2/26/25 20:37, Jiasheng Jiang wrote:
> Since the driver is broken in the case that src->freq_supported is not
> NULL but src->freq_supported_num is 0, add an assertion for it.
> 
> Signed-off-by: Jiasheng Jiang <jiashengjiangcool@gmail.com>
> ---
> Changelog:
> 
> v2 -> v3:

please post next revision as a separate thread instead of
in-reply-to the previous one

please also do wait a minimum of 24h prior to submitting a new
revision

> 
> 1. Add "net-next" to the subject.
> 2. Remove the "Fixes" tag and "Cc: stable".
> 3. Replace BUG_ON with WARN_ON.
> 
> v1 -> v2:
> 
> 1. Replace the check with an assertion.
> ---
>   drivers/dpll/dpll_core.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/dpll/dpll_core.c b/drivers/dpll/dpll_core.c
> index 32019dc33cca..0927eddbd417 100644
> --- a/drivers/dpll/dpll_core.c
> +++ b/drivers/dpll/dpll_core.c
> @@ -443,8 +443,9 @@ static void dpll_pin_prop_free(struct dpll_pin_properties *prop)
>   static int dpll_pin_prop_dup(const struct dpll_pin_properties *src,
>   			     struct dpll_pin_properties *dst)
>   {
> +	WARN_ON(src->freq_supported && !src->freq_supported_num);

Jiri has asked for an early return too

>   	memcpy(dst, src, sizeof(*dst));
> -	if (src->freq_supported && src->freq_supported_num) {
> +	if (src->freq_supported) {
>   		size_t freq_size = src->freq_supported_num *
>   				   sizeof(*src->freq_supported);
>   		dst->freq_supported = kmemdup(src->freq_supported,


      parent reply	other threads:[~2025-02-27  5:21 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-23 20:17 [PATCH] dpll: Add a check before kfree() to match the existing check before kmemdup() Jiasheng Jiang
2025-02-24  9:31 ` Kubalewski, Arkadiusz
2025-02-24 12:04   ` Jiri Pirko
2025-02-24 16:47     ` Jiasheng Jiang
2025-02-25 12:08       ` Jiri Pirko
2025-02-26  3:09         ` [PATCH v2] dpll: Add an assertion to check freq_supported_num Jiasheng Jiang
2025-02-26 14:24           ` Jiri Pirko
2025-02-26 19:37             ` [PATCH v3 net-next] " Jiasheng Jiang
2025-02-26 19:38               ` kernel test robot
2025-02-27  5:21               ` Przemek Kitszel [this message]

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=34b2c92f-e879-4a9e-beb6-c6786bd59c9d@intel.com \
    --to=przemyslaw.kitszel@intel.com \
    --cc=arkadiusz.kubalewski@intel.com \
    --cc=davem@davemloft.net \
    --cc=jan.glaza@intel.com \
    --cc=jiashengjiangcool@gmail.com \
    --cc=jiri@resnulli.us \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    --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