Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp1149904pxv; Fri, 9 Jul 2021 19:36:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJznL2okM4EGXCcYB08u3gLjRBmDztwsdXXLGR0ufM7Rhq8lnZF6K3HicQOrzdkErJljX9P0 X-Received: by 2002:a02:a797:: with SMTP id e23mr1864069jaj.121.1625884596190; Fri, 09 Jul 2021 19:36:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625884596; cv=none; d=google.com; s=arc-20160816; b=ng6eJsESS4VfxkgFNt4ny7OA1fM9ECqF83VOFEkflHBgLcuQn4st9BaYXvgh9o5W5q YLkgb+U32Sq2/rmEnYMeUJ5d6e/HQ30HCyWUmwkclqK4wFO2D0JLQU13jh2xmjm8noQa mC8v7SZD7ugz7idGyuckRH5k47ix7XeqJR1x1/itP/COgnWYt0bHk1AgeO8AXpNf7DaR 4IBfgFedjiEsL9OB7p/XGszPkzDL0i2uryfJiCEz8aX64Gsw1dm39BTDWslDC8mLgBvi 7pcYJktEMXknCEpg25NYj6pyOO/91SnZh0Iu8CdAY3anERizXmUbVlVs7Nx+9Zs9VwN6 E0aw== 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 :dkim-signature; bh=6YIVMJRayLzTdQ/BeHZGukEceDKDpwHP6ta7rm59ZNo=; b=1KIQ0dEfwEmHimV79Hq/R3ehY88hzE/VYzidBQ2MV2EwwaGe0T7V3Ez3HT2sJFDvk+ n1Ev8OZu59stVRJ3s4Zna/itHpf98PJboRgnbClzWmlqNPD6mKFqZCV+krh5KJyQU55Y uxf7HHOeR0feb1PN/pwsYUW2iJiMk/IxeENXMXPG1I8uh0SLFZPJd7rvVmeFbG6LV++M 7FFeSbj4e8Hn5nrG3qA7GZ4DHOGWEjRySx139yHHNJaDe0UeRKc7QwTNj6u1jINV3SqC CBoyq21Hj4H6c8RgEI1OULPWhYosVVA7Q2z1MH55+y+IdGJEknYKYfBjnc/YFXFHkxnT KCcQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="O/SFGDVe"; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j25si7539412jaj.93.2021.07.09.19.36.24; Fri, 09 Jul 2021 19:36:36 -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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="O/SFGDVe"; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234237AbhGJCil (ORCPT + 99 others); Fri, 9 Jul 2021 22:38:41 -0400 Received: from mail.kernel.org ([198.145.29.99]:53382 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235707AbhGJCfA (ORCPT ); Fri, 9 Jul 2021 22:35:00 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 39FFF613D3; Sat, 10 Jul 2021 02:32:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1625884335; bh=AoD/7CWDXvR+9ak/sKEZmG77jR/GQC1p+n/HlENlaC4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=O/SFGDVeo/SsBOA3ZyAK2JfixOFQSDo5mW1uZCreJA9u9MhlnTgoQotO31F/YD6si gR4esTJS4zc2pTG89P7MwAvwCq7c6LErGLDKm9GsTj+jZW34ErosGfpCw1t3szb5bZ wgoKUqZSc2LSwjVJTSfaZ3DI+hluPPeaoFTddem7jZjmn/+zdjpcVkLL6L8L9RjYGQ e3tblEAeDDxG01L5vkcl/x5Pg0fx3zB2cmZRAk/gYKKy/izhu2HvgbQc0IvEmVOq8t OsCsE+WbR9dwgx9RIi02amp0SmEH55LXDLKJzbfu7LP1v+EYYLLNifXWppSn74nyrV T1zn1ifARlQEA== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Yufen Yu , Hulk Robot , Takashi Iwai , Sasha Levin , alsa-devel@alsa-project.org Subject: [PATCH AUTOSEL 4.19 09/39] ALSA: ac97: fix PM reference leak in ac97_bus_remove() Date: Fri, 9 Jul 2021 22:31:34 -0400 Message-Id: <20210710023204.3171428-9-sashal@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210710023204.3171428-1-sashal@kernel.org> References: <20210710023204.3171428-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Yufen Yu [ Upstream commit a38e93302ee25b2ca6f4ee76c6c974cf3637985e ] 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: Yufen Yu Link: https://lore.kernel.org/r/20210524093811.612302-1-yuyufen@huawei.com Signed-off-by: Takashi Iwai Signed-off-by: Sasha Levin --- sound/ac97/bus.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/ac97/bus.c b/sound/ac97/bus.c index ca50ff444796..d8b227e6d4cf 100644 --- a/sound/ac97/bus.c +++ b/sound/ac97/bus.c @@ -523,7 +523,7 @@ static int ac97_bus_remove(struct device *dev) struct ac97_codec_driver *adrv = to_ac97_driver(dev->driver); int ret; - ret = pm_runtime_get_sync(dev); + ret = pm_runtime_resume_and_get(dev); if (ret < 0) return ret; -- 2.30.2