[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241021072120.739-1-thunder.leizhen@huawei.com>
Date: Mon, 21 Oct 2024 15:21:19 +0800
From: Zhen Lei <thunder.leizhen@...wei.com>
To: Suzuki K Poulose <suzuki.poulose@....com>, Mike Leach
<mike.leach@...aro.org>, James Clark <james.clark@...aro.org>, Alexander
Shishkin <alexander.shishkin@...ux.intel.com>, Mathieu Poirier
<mathieu.poirier@...aro.org>, Anshuman Khandual <anshuman.khandual@....com>,
<coresight@...ts.linaro.org>, <linux-arm-kernel@...ts.infradead.org>,
<linux-kernel@...r.kernel.org>
CC: Zhen Lei <thunder.leizhen@...wei.com>, Markus Elfring
<Markus.Elfring@....de>
Subject: [PATCH v2 1/1] coresight: trbe: Fix return value check in arm_trbe_register_coresight_cpu()
The commit in the 'Fixes:' uses devm_kzalloc() to allocate platform data
memory instead of coresight_get_platform_data(), but forgot to update the
return value check code accordingly. Fix the incorrect return value check
for devm_kzalloc(), which returns NULL instead of ERR_PTR() when it fails.
Fixes: 4277f035d227 ("coresight: trbe: Add a representative coresight_platform_data for TRBE")
Signed-off-by: Zhen Lei <thunder.leizhen@...wei.com>
Reviewed-by: James Clark <james.clark@...aro.org>
Reviewed-by: Anshuman Khandual <anshuman.khandual@....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 96a32b213669940..93fe9860acf16bd 100644
--- a/drivers/hwtracing/coresight/coresight-trbe.c
+++ b/drivers/hwtracing/coresight/coresight-trbe.c
@@ -1266,7 +1266,7 @@ static void arm_trbe_register_coresight_cpu(struct trbe_drvdata *drvdata, int cp
* 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;
--
2.34.1
Powered by blists - more mailing lists