Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp455454pxf; Thu, 8 Apr 2021 06:37:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxZh+XIstOINtTPI4W+WwzU4pUxIbx+0nMAIp/FRYpOfq3y8UI96HRhFXhKJJrvXvI5Laj5 X-Received: by 2002:a17:90a:c712:: with SMTP id o18mr8439460pjt.97.1617889063831; Thu, 08 Apr 2021 06:37:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617889063; cv=none; d=google.com; s=arc-20160816; b=AO+QkLjpyKf3Gw30VSt0rm6pAV32OmY1lMb/zUHYSzolE+PaCbzyBpP9vTBLiCrtiB jWvi51PcVbdik5lWHJrl5ORQpw0mCaNYFWYxpMQgJxKnq75WLtDL+PLnrfcYkVs3GeME 1kObHJSFGIPZ48yhXDICNdEPmbYYcP6/AjWszh6B3AWA7pY92DfQGpxgcX3Kn3SX0Z5s dmbFEw1Se1HzWFkH9pkKBMU/3SfKr1CEOgGiAI1sAVK2gs68q5fe2z+0ScL937kQuEJ6 kFRudMundND+RjnJGeiIHXPqYqkX6YpjFg2IvtWFnxvgdEIqDbpL7+e6fcqoFHQyQbP1 FHtg== 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 :message-id:date:subject:cc:to:from; bh=Ux8QAeQEQLjDvxpM6HjcwVipvJnD39R0czKimUCEYDI=; b=0M/BOgqBcVWRcsbLuzov+71yyWvXhpl5LdLyJdnAt9fM3AF6ciy72QsO+GPBxH7Ur+ jn/EuQqznBUO0h5hEdQNBG44r8U/1MeBEBn8U6zG+BRHG5mr5Zrecr6G9GzhxH9BsV/d Sl5hA0WNJnxeVfO981W5vluMSKtLhLSMudtyGRA4cCLE0yPr9dB8q1kzsyTYWUEempHL Drq6sKwxNhHI9CHLLZqw5q0E0YvquCRt79iAePbf7udgcVr32ZJUjH0UYG6nuv/RlUsI a5nMauT0c8XiDSrmWSJnYQ60MrmrIcs5mb6Dt7BuTBaJrE7M/kyZU8pnzAX/YypR4YV7 z26Q== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m9si27765148pll.311.2021.04.08.06.37.31; Thu, 08 Apr 2021 06:37:43 -0700 (PDT) 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231719AbhDHNgt (ORCPT + 99 others); Thu, 8 Apr 2021 09:36:49 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:16846 "EHLO szxga07-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231255AbhDHNgs (ORCPT ); Thu, 8 Apr 2021 09:36:48 -0400 Received: from DGGEMS410-HUB.china.huawei.com (unknown [172.30.72.58]) by szxga07-in.huawei.com (SkyGuard) with ESMTP id 4FGMgL5xYXz9wbq; Thu, 8 Apr 2021 21:34:22 +0800 (CST) Received: from ubuntu1804.huawei.com (10.67.174.175) by DGGEMS410-HUB.china.huawei.com (10.3.19.210) with Microsoft SMTP Server id 14.3.498.0; Thu, 8 Apr 2021 21:36:26 +0800 From: Lu Jialin To: , Jernej Skrabec , "Mauro Carvalho Chehab" , Maxime Ripard , Chen-Yu Tsai , Philipp Zabel CC: , , , , Subject: [PATCH -next] media: sun8i: Fix PM reference leak in deinterlace_start_streaming() Date: Thu, 8 Apr 2021 21:36:30 +0800 Message-ID: <20210408133630.56299-1-lujialin4@huawei.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.67.174.175] 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 it failed. Forgetting to putting operation will result in reference leak here. Fix it by replacing it with pm_runtime_resume_and_get to keep usage counter balanced. Reported-by: Hulk Robot Signed-off-by: Lu Jialin --- drivers/media/platform/sunxi/sun8i-di/sun8i-di.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/platform/sunxi/sun8i-di/sun8i-di.c b/drivers/media/platform/sunxi/sun8i-di/sun8i-di.c index ed863bf5ea80..671e4a928993 100644 --- a/drivers/media/platform/sunxi/sun8i-di/sun8i-di.c +++ b/drivers/media/platform/sunxi/sun8i-di/sun8i-di.c @@ -589,7 +589,7 @@ static int deinterlace_start_streaming(struct vb2_queue *vq, unsigned int count) int ret; if (V4L2_TYPE_IS_OUTPUT(vq->type)) { - ret = pm_runtime_get_sync(dev); + ret = pm_runtime_resume_and_get(dev); if (ret < 0) { dev_err(dev, "Failed to enable module\n");