mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v2 1/1] coresight: trbe: Fix return value check in arm_trbe_register_coresight_cpu()
@ 2024-10-21  7:21 Zhen Lei
  2024-10-21 10:25 ` [PATCH v2] " Markus Elfring
  0 siblings, 1 reply; 3+ messages in thread
From: Zhen Lei @ 2024-10-21  7:21 UTC (permalink / raw)
  To: Suzuki K Poulose, Mike Leach, James Clark, Alexander Shishkin,
	Mathieu Poirier, Anshuman Khandual, coresight, linux-arm-kernel,
	linux-kernel
  Cc: Zhen Lei, Markus Elfring

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@huawei.com>
Reviewed-by: James Clark <james.clark@linaro.org>
Reviewed-by: Anshuman Khandual <anshuman.khandual@arm.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


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-10-22  3:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-10-21  7:21 [PATCH v2 1/1] coresight: trbe: Fix return value check in arm_trbe_register_coresight_cpu() Zhen Lei
2024-10-21 10:25 ` [PATCH v2] " Markus Elfring
2024-10-22  3:00   ` Leizhen (ThunderTown)

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®