mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ben Horgan <ben.horgan@arm.com>
To: Ping Li <leeonion.muyu@gmail.com>, james.morse@arm.com
Cc: linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org, reinette.chatre@intel.com,
	fenghuay@nvidia.com
Subject: Re: [PATCH] arm_mpam: Free error_dev_id when destroying an MSC
Date: Thu, 3 Dec 2026 16:15:25 +0000	[thread overview]
Message-ID: <c02a5743-281e-4581-8acb-6f0071fe4959@arm.com> (raw)
In-Reply-To: <20261027111914.850854-1-leeonion.muyu@gmail.com>

Hi Ping,

On 27/10/2026 11:19, Ping Li wrote:
> error_dev_id is allocated with alloc_percpu() when the MSC has a
> per-CPU error interrupt, but is never freed. free_percpu_irq() only
> releases the irqaction, not the percpu allocation. The msc structure
> itself is devm managed, so the leak survives its devm_kfree().
> 
> free_percpu() accepts NULL, so MSCs without a PPI error interrupt
> are unaffected.
> 
> Signed-off-by: Ping Li <leeonion.muyu@gmail.com>
> ---
>  drivers/resctrl/mpam_devices.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/resctrl/mpam_devices.c b/drivers/resctrl/mpam_devices.c
> index 48adc49b833c..bff0b5da0fe6 100644
> --- a/drivers/resctrl/mpam_devices.c
> +++ b/drivers/resctrl/mpam_devices.c
> @@ -2423,6 +2423,7 @@ static void mpam_msc_destroy(struct mpam_msc *msc)
>  	list_del_rcu(&msc->all_msc_list);
>  	synchronize_srcu(&mpam_srcu);
>  	mpam_pcc_chan_put(msc->pcc_chan);
> +	free_percpu(msc->error_dev_id);

With this the msc->error_dev_id is still leaked if the probe fails. As such, I'm planning on taking
https://lore.kernel.org/linux-arm-kernel/20261124135843.2276437-1-liguangshuo@mail.sdu.edu.cn/ instead of this patch
even though you did post first.

Thanks,

Ben

>  	platform_set_drvdata(pdev, NULL);
>  
>  	add_to_garbage(msc);


      reply	other threads:[~2026-12-03 16:15 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-27 11:19 Ping Li
2026-12-03 16:15 ` Ben Horgan [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=c02a5743-281e-4581-8acb-6f0071fe4959@arm.com \
    --to=ben.horgan@arm.com \
    --cc=fenghuay@nvidia.com \
    --cc=james.morse@arm.com \
    --cc=leeonion.muyu@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=reinette.chatre@intel.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

all inboxes | Powered by JetHome®