public inbox for linux-kernel@vger.kernel.org
 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 related	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] coresight: trbe: Fix return value check in arm_trbe_register_coresight_cpu()
  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 ` Markus Elfring
  2024-10-22  3:00   ` Leizhen (ThunderTown)
  0 siblings, 1 reply; 3+ messages in thread
From: Markus Elfring @ 2024-10-21 10:25 UTC (permalink / raw)
  To: Zhen Lei, coresight, linux-arm-kernel, Alexander Shishkin,
	Anshuman Khandual, James Clark, Mathieu Poirier, Mike Leach,
	Suzuki Poulouse
  Cc: LKML> 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.
> ---
>  drivers/hwtracing/coresight/coresight-trbe.c | 2 +-
…

It would have been nice to add a patch version description.

See also:
* https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?h=v6.12-rc4#n321

* https://lore.kernel.org/all/?q=%22This+looks+like+a+new+version+of+a+previously+submitted+patch%22


Regards,
Markus

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

* Re: [PATCH v2] coresight: trbe: Fix return value check in arm_trbe_register_coresight_cpu()
  2024-10-21 10:25 ` [PATCH v2] " Markus Elfring
@ 2024-10-22  3:00   ` Leizhen (ThunderTown)
  0 siblings, 0 replies; 3+ messages in thread
From: Leizhen (ThunderTown) @ 2024-10-22  3:00 UTC (permalink / raw)
  To: Markus Elfring, coresight, linux-arm-kernel, Alexander Shishkin,
	Anshuman Khandual, James Clark, Mathieu Poirier, Mike Leach,
	Suzuki Poulouse
  Cc: LKML



On 2024/10/21 18:25, Markus Elfring wrote:
> …
>> 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.
> …
>> ---
>>  drivers/hwtracing/coresight/coresight-trbe.c | 2 +-
> …
> 
> It would have been nice to add a patch version description.

Yes, I forgot the description, thanks. Only the commit message is updated in v2,
especially Fixes. But I'm not going to post v3.

> 
> See also:
> * https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?h=v6.12-rc4#n321
> 
> * https://lore.kernel.org/all/?q=%22This+looks+like+a+new+version+of+a+previously+submitted+patch%22
> 
> 
> Regards,
> Markus
> .
> 

-- 
Regards,
  Zhen Lei

^ 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