Skip to content
Commit cfa5dbcd authored by Miaoqian Lin's avatar Miaoqian Lin Committed by Suzuki K Poulose
Browse files

coresight: syscfg: Fix memleak on registration failure in cscfg_create_device



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: default avatarMiaoqian Lin <linmq006@gmail.com>
Fixes: 85e2414c ("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: default avatarMathieu Poirier <mathieu.poirier@linaro.org>
Signed-off-by: default avatarSuzuki K Poulose <suzuki.poulose@arm.com>
parent ea75a342
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment