linux-stable/drivers/hwtracing
Miaoqian Lin 412225b329 coresight: syscfg: Fix memleak on registration failure in cscfg_create_device
commit cfa5dbcdd7 upstream.

device_register() calls device_initialize(),
according to doc of device_initialize:

    Use put_device() to give up your reference instead of freeing
    * @dev directly once you have called this function.

To prevent potential memleak, use put_device() for error handling.

Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
Fixes: 85e2414c51 ("coresight: syscfg: Initial coresight system configuration")
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20220124124121.8888-1-linmq006@gmail.com
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-04-08 13:57:14 +02:00
..
coresight coresight: syscfg: Fix memleak on registration failure in cscfg_create_device 2022-04-08 13:57:14 +02:00
intel_th bus: Make remove callback return void 2021-07-21 11:53:42 +02:00
stm stm class: Use correct UUID APIs 2021-04-16 07:26:50 +02:00
Kconfig treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00