soc: ti: knav_qmss: fix reference leak in knav_queue_probe
authorZhang Qilong <zhangqilong3@huawei.com>
Sun, 22 Nov 2020 03:22:00 +0000 (19:22 -0800)
committerSantosh Shilimkar <santosh.shilimkar@oracle.com>
Sun, 22 Nov 2020 03:22:00 +0000 (19:22 -0800)
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>
drivers/soc/ti/knav_qmss_queue.c

index a460f201bf8e70ae4d89cdc48695175dbb1b1092..54afa8f7f4087c2db29059b9a33cb5b067b6580d 100644 (file)
@@ -1784,6 +1784,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;
        }