diff mbox series

[v2,1/1] coresight: trbe: Fix return value check in arm_trbe_register_coresight_cpu()

Message ID 20241021072120.739-1-thunder.leizhen@huawei.com (mailing list archive)
State New
Headers show
Series [v2,1/1] coresight: trbe: Fix return value check in arm_trbe_register_coresight_cpu() | expand

Commit Message

Leizhen (ThunderTown) Oct. 21, 2024, 7:21 a.m. UTC
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(-)

Comments

Markus Elfring Oct. 21, 2024, 10:25 a.m. UTC | #1
> 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
Leizhen (ThunderTown) Oct. 22, 2024, 3 a.m. UTC | #2
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
> .
>
diff mbox series

Patch

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;