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] [day] [month] [year] [list]
Message-ID: <fa9d3b0e-71d9-4fa9-8522-185ebdddcf00@linaro.org>
Date: Mon, 8 Sep 2025 13:38:26 +0100
From: James Clark <james.clark@...aro.org>
To: Lin Yujun <linyujun809@...artners.com>, suzuki.poulose@....com
Cc: linux-kernel@...r.kernel.org,
 "coresight@...ts.linaro.org" <coresight@...ts.linaro.org>,
 mike.leach@...aro.org, alexander.shishkin@...ux.intel.com,
 anshuman.khandual@....com, Leo Yan <leo.yan@....com>
Subject: Re: [PATCH -next] coresight: Fix incorrect handling for return value
 of devm_kzalloc



On 08/09/2025 1:20 pm, Lin Yujun wrote:
> The return value of devm_kzalloc could be an null pointer,
> use "!desc.pdata" to fix incorrect handling return value
> of devm_kzalloc.
> 
> Fixes: 4277f035d227 ("coresight: trbe: Add a representative coresight_platform_data for TRBE")
> Signed-off-by: Lin Yujun <linyujun809@...artners.com>
> ---
>   drivers/hwtracing/coresight/coresight-trbe.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/hwtracing/coresight/coresight-trbe.c b/drivers/hwtracing/coresight/coresight-trbe.c
> index 8267dd1a2130..caf873adfc3a 100644
> --- a/drivers/hwtracing/coresight/coresight-trbe.c
> +++ b/drivers/hwtracing/coresight/coresight-trbe.c
> @@ -1277,11 +1277,11 @@ static void arm_trbe_register_coresight_cpu(struct trbe_drvdata *drvdata, int cp
>   	 * ends up failing. Instead let's allocate a dummy zeroed
>   	 * coresight_platform_data structure and assign that back
>   	 * into the device for that purpose.
>   	 */
>   	desc.pdata = devm_kzalloc(dev, sizeof(*desc.pdata), GFP_KERNEL);
> -	if (IS_ERR(desc.pdata))
> +	if (!desc.pdata)
>   		goto cpu_clear;
>   
>   	desc.type = CORESIGHT_DEV_TYPE_SINK;
>   	desc.subtype.sink_subtype = CORESIGHT_DEV_SUBTYPE_SINK_PERCPU_SYSMEM;
>   	desc.ops = &arm_trbe_cs_ops;

Reviewed-by: James Clark <james.clark@...aro.org>


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ