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 |
… > 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
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 --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;