Skip to content

Commit 961b6ff

Browse files
Ding Xianggregkh
authored andcommitted
stm class: Fix a double free of stm_source_device
In the error path of stm_source_register_device(), the kfree is unnecessary, as the put_device() before it ends up calling stm_source_device_release() to free stm_source_device, leading to a double free at the outer kfree() call. Remove it. Signed-off-by: Ding Xiang <[email protected]> Signed-off-by: Alexander Shishkin <[email protected]> Fixes: 7bd1d40 ("stm class: Introduce an abstraction for System Trace Module devices") Link: https://lore.kernel.org/linux-arm-kernel/[email protected]/ Cc: [email protected] # v4.4+ Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent c78439f commit 961b6ff

File tree

1 file changed

+0
-1
lines changed

1 file changed

+0
-1
lines changed

drivers/hwtracing/stm/core.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1276,7 +1276,6 @@ int stm_source_register_device(struct device *parent,
12761276

12771277
err:
12781278
put_device(&src->dev);
1279-
kfree(src);
12801279

12811280
return err;
12821281
}

0 commit comments

Comments
 (0)