mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 1/1] coresight: trbe: Fix return value check in arm_trbe_register_coresight_cpu()
@ 2024-10-18 14:08 Zhen Lei
  2024-10-18 16:02 ` James Clark
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Zhen Lei @ 2024-10-18 14:08 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

Function devm_kzalloc() returns NULL instead of ERR_PTR() when it fails.
The IS_ERR() test in the return value check should be replaced with NULL
test.

Fixes: 39744738a67d ("coresight: trbe: Allocate platform data per device")
Fixes: 3fbf7f011f24 ("coresight: sink: Add TRBE driver")
Signed-off-by: Zhen Lei <thunder.leizhen@huawei.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] 5+ messages in thread

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

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-10-18 14:08 [PATCH 1/1] coresight: trbe: Fix return value check in arm_trbe_register_coresight_cpu() Zhen Lei
2024-10-18 16:02 ` James Clark
2024-10-18 16:26 ` [PATCH] " Markus Elfring
2024-10-21  2:58 ` [PATCH 1/1] " Anshuman Khandual
2024-10-21  3:57   ` 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®