lkml.org 
[lkml]   [2020]   [Dec]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 4.14 102/242] soc: ti: knav_qmss: fix reference leak in knav_queue_probe
    Date
    From: Zhang Qilong <zhangqilong3@huawei.com>

    [ Upstream commit ec8684847d8062496c4619bc3fcff31c19d56847 ]

    pm_runtime_get_sync will increment pm usage counter even it
    failed. Forgetting to pm_runtime_put_noidle will result in
    reference leak in knav_queue_probe, so we should fix it.

    Fixes: 41f93af900a20 ("soc: ti: add Keystone Navigator QMSS driver")
    Signed-off-by: Zhang Qilong <zhangqilong3@huawei.com>
    Signed-off-by: Santosh Shilimkar <santosh.shilimkar@oracle.com>
    Signed-off-by: Sasha Levin <sashal@kernel.org>
    ---
    drivers/soc/ti/knav_qmss_queue.c | 1 +
    1 file changed, 1 insertion(+)

    diff --git a/drivers/soc/ti/knav_qmss_queue.c b/drivers/soc/ti/knav_qmss_queue.c
    index 9879ca5f8c5f5..eef79cd5a7238 100644
    --- a/drivers/soc/ti/knav_qmss_queue.c
    +++ b/drivers/soc/ti/knav_qmss_queue.c
    @@ -1719,6 +1719,7 @@ static int knav_queue_probe(struct platform_device *pdev)
    pm_runtime_enable(&pdev->dev);
    ret = pm_runtime_get_sync(&pdev->dev);
    if (ret < 0) {
    + pm_runtime_put_noidle(&pdev->dev);
    dev_err(dev, "Failed to enable QMSS\n");
    return ret;
    }
    --
    2.27.0


    \
     
     \ /
      Last update: 2020-12-28 14:40    [W:4.067 / U:0.028 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site