Skip to content

Commit 70714eb

Browse files
Lin YujunSuzuki K Poulose
authored andcommitted
coresight: Fix incorrect handling for return value of devm_kzalloc
The return value of devm_kzalloc could be an null pointer, use "!desc.pdata" to fix incorrect handling return value of devm_kzalloc. Fixes: 4277f03 ("coresight: trbe: Add a representative coresight_platform_data for TRBE") Signed-off-by: Lin Yujun <[email protected]> Reviewed-by: James Clark <[email protected]> Signed-off-by: Suzuki K Poulose <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 43e0a92 commit 70714eb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/hwtracing/coresight/coresight-trbe.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1280,7 +1280,7 @@ static void arm_trbe_register_coresight_cpu(struct trbe_drvdata *drvdata, int cp
12801280
* into the device for that purpose.
12811281
*/
12821282
desc.pdata = devm_kzalloc(dev, sizeof(*desc.pdata), GFP_KERNEL);
1283-
if (IS_ERR(desc.pdata))
1283+
if (!desc.pdata)
12841284
goto cpu_clear;
12851285

12861286
desc.type = CORESIGHT_DEV_TYPE_SINK;

0 commit comments

Comments
 (0)