Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp3550299pxu; Mon, 30 Nov 2020 05:40:58 -0800 (PST) X-Google-Smtp-Source: ABdhPJwxBntdFMf8A8Og3EING+Qr7AvIpeSzMRUZ47x7jzMMPbNe1JoyjZuyRvM4TDFaSYunQI64 X-Received: by 2002:a17:906:68c4:: with SMTP id y4mr21469431ejr.332.1606743651880; Mon, 30 Nov 2020 05:40:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606743651; cv=none; d=google.com; s=arc-20160816; b=MF1CHUw2QzHMFLqdtcm+dM5o9PDj4jEWU0hMU8TIzVlwUNcExB9vkybI8cVMTF4nBF 7FfOfs1MAx5mlBk0pS0z3AEOLtZ7JfdF+aRiPOzhAuGbmDPQRIcyLvcrbqaQuWzmGumT QMoOf+87z56/22gel8QMYzQoDVW0gmaWkvmANt4vNGNmZLSOX/c71c7x0lPFmfuz7lwM AYP/Nv3C/KswYc+MYhnZ53hQQAp2Hy+EOidaK8dDpfJfHOmy3KKlPfONqQrunRpgs2PR rYWfByWwxLSeUicH4HcE+3jLUrbjiljK8fgBhHQQCzZRI0Gt7FyTN1Hox7kYOVC2nIqJ cdKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=4iJbstAQQ1C2VHbfmMd7uPBFYX/QqPa4epLypAuWBBc=; b=VL8i5VwC4h9+UvJroM4Xq65V+9FFgbV4VzgmUGKGKQtwklufii8bX7H26e3rujuI9A KhV6O8ZC5wQaORMWEhr9bnhnh9c8C1jaYthsmpVZbKjAyGr8WrqQkDTP9cTwp+AAq+tN PYU0RPk7ySxpPkwsVRbjqqSwR09XBOPctHZTiZOHXpLCICHiXB0XGt6VoiV9gX03SBUI qCz1QVBIrQ8Vy5WP7H/VvXdL/ZBKIazBrA95yq25ykohi2V7s3VEbO6v+pfNbLQwUyEu t4wHILQ+y8d7gu88zEKuHCuZ5abeoG9Yw2xS4CNz2n/yRWnmWXFgVmGV6a3Q1lXhXX3t EuIQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s10si11022097edt.506.2020.11.30.05.40.29; Mon, 30 Nov 2020 05:40:51 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726746AbgK3NhO (ORCPT + 99 others); Mon, 30 Nov 2020 08:37:14 -0500 Received: from szxga05-in.huawei.com ([45.249.212.191]:8536 "EHLO szxga05-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726471AbgK3NhO (ORCPT ); Mon, 30 Nov 2020 08:37:14 -0500 Received: from DGGEMS412-HUB.china.huawei.com (unknown [172.30.72.58]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4Cl5pv36WgzhjMS; Mon, 30 Nov 2020 21:36:07 +0800 (CST) Received: from localhost.localdomain.localdomain (10.175.113.25) by DGGEMS412-HUB.china.huawei.com (10.3.19.212) with Microsoft SMTP Server id 14.3.487.0; Mon, 30 Nov 2020 21:36:25 +0800 From: Qinglang Miao To: Sandy Huang , =?UTF-8?q?Heiko=20St=C3=BCbner?= , David Airlie , Daniel Vetter CC: , , , , Qinglang Miao Subject: [PATCH 1/3] drm/rockchip: cdn-dp: fix reference leak when pm_runtime_get_sync fails Date: Mon, 30 Nov 2020 21:44:25 +0800 Message-ID: <20201130134427.57545-2-miaoqinglang@huawei.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20201130134427.57545-1-miaoqinglang@huawei.com> References: <20201130134427.57545-1-miaoqinglang@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.175.113.25] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org pm_runtime_get_sync will increment pm usage counter even failed. Forgetting to putting operation will result in a reference leak here. Replace it with pm_runtime_resume_and_get to keep usage counter balanced. Fixes: efe0220fc2d2 ("drm/rockchip: cdn-dp: Fix error handling") Reported-by: Hulk Robot Signed-off-by: Qinglang Miao --- drivers/gpu/drm/rockchip/cdn-dp-core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/rockchip/cdn-dp-core.c b/drivers/gpu/drm/rockchip/cdn-dp-core.c index a4a45daf9..9b4406191 100644 --- a/drivers/gpu/drm/rockchip/cdn-dp-core.c +++ b/drivers/gpu/drm/rockchip/cdn-dp-core.c @@ -98,7 +98,7 @@ static int cdn_dp_clk_enable(struct cdn_dp_device *dp) goto err_core_clk; } - ret = pm_runtime_get_sync(dp->dev); + ret = pm_runtime_resume_and_get(dp->dev); if (ret < 0) { DRM_DEV_ERROR(dp->dev, "cannot get pm runtime %d\n", ret); goto err_pm_runtime_get; -- 2.23.0