lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAJ9a7ViDJKRCMn6wqHC-F+ohU_gRa3BzgaFoGzcd0TeDmNLKVg@mail.gmail.com>
Date: Fri, 26 Sep 2025 11:16:34 +0100
From: Mike Leach <mike.leach@...aro.org>
To: Sean Anderson <sean.anderson@...ux.dev>
Cc: Suzuki K Poulose <suzuki.poulose@....com>, coresight@...ts.linaro.org, 
	linux-arm-kernel@...ts.infradead.org, Leo Yan <leo.yan@....com>, 
	Yeoreum Yun <yeoreum.yun@....com>, Linu Cherian <lcherian@...vell.com>, linux-kernel@...r.kernel.org, 
	Alexander Shishkin <alexander.shishkin@...ux.intel.com>, James Clark <james.clark@...aro.org>
Subject: Re: [PATCH v5 1/3] coresight: Fix fwnode leak in coresight_register
 error path

On Thu, 25 Sept 2025 at 16:04, Sean Anderson <sean.anderson@...ux.dev> wrote:
>
> If registering the CPU map fails, we need to put the fwnode. free_percpu
> works when called with a NULL pointer, so just use
> coresight_device_release.
>
> Fixes: 5ad628a76176 ("coresight: Use per-sink trace ID maps for Perf sessions")
> Signed-off-by: Sean Anderson <sean.anderson@...ux.dev>
> ---
>
> (no changes since v4)
>
> Changes in v4:
> - New
>
>  drivers/hwtracing/coresight/coresight-core.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/hwtracing/coresight/coresight-core.c b/drivers/hwtracing/coresight/coresight-core.c
> index fa758cc21827..022c8384b98d 100644
> --- a/drivers/hwtracing/coresight/coresight-core.c
> +++ b/drivers/hwtracing/coresight/coresight-core.c
> @@ -1352,7 +1352,7 @@ struct coresight_device *coresight_register(struct coresight_desc *desc)
>                 raw_spin_lock_init(&csdev->perf_sink_id_map.lock);
>                 csdev->perf_sink_id_map.cpu_map = alloc_percpu(atomic_t);
>                 if (!csdev->perf_sink_id_map.cpu_map) {
> -                       kfree(csdev);
> +                       coresight_device_release(&csdev->dev);
>                         ret = -ENOMEM;
>                         goto err_out;
>                 }
> --
> 2.35.1.1320.gc452695387.dirty
>

Reviewed-by: Mike Leach <mike.leach@...aro.org>

-- 
Mike Leach
Principal Engineer, ARM Ltd.
Manchester Design Centre. UK

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ