Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp1146774pxv; Fri, 9 Jul 2021 19:30:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyKEJfrqH7SIWyAXuCm5kvAaOtj8t/17VcuzlGMGyGd930rCLqIr63V5LYWoVgxE4MA8lEg X-Received: by 2002:a17:906:7304:: with SMTP id di4mr40268511ejc.531.1625884209622; Fri, 09 Jul 2021 19:30:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625884209; cv=none; d=google.com; s=arc-20160816; b=ZbPICBVQhMR2qnrd2gli7d23VRVJqtMJHX+XbItEAvxkO+EvMgMRspCR8qczPS6S1p MRvIVyizS+OjOqHtjNSfGTLiF4VsbesGbJu/Yue1sKWtDrt+fLveMNITvdl9+oNcdpjU nxOwM3NdMASlOLzRQlMRBom5UR0lEeOcZyslEM5fbYGtyDeMzHYwCiMoMn45ehKBVWWd pXne0pTGIBk1hw956KSwKoVsrrxtWu8Ns5kxLbVWfUGFT8zWZVOCsf5sLUClv07NeKzb +dlJ4dvul4GGuP0NjmF3c8vSHCFmJCwqUp3t6VgoBdHUDEiA8lgn8fKWAeMAEcZRI/uu GFrA== 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=1dFN555/LvRxmzpBU7sVMTUZVaQpvBzE0CNwe25H/Xg=; b=saIXRGG0dfjHUMqBHQO24VEp0eIhCwQOmJ9U2042R89WnlfShVzqGtL53s9+7w2j9C ZhGuKMAUgoZWqVN+VYExJspE58n05UqE9YYm6AhAcYNvC0dw4DKID+l4idvyCnbAErf2 uLK/o7Yz0zG8ZmkwGPzxdLNkyNDbej7SHvgZxgfzQajLiUQL/bluEKSmVoIx4e0n/c2v 6/caYZ5DLcahZp0eME4dPm8vMYl9v8GvGY6sOzAEyyRfhrqu8aAP1Y3rh+8gybAzbqb9 XbrB62XgCdrTB7iqD2ZV8YiyqBK+bXDzAVfhMPu/+CFiwRVS5YA65EvRuyqDFhgJ/DsY feyQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=L9umgiQf; 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 r23si9749142edo.404.2021.07.09.19.29.46; Fri, 09 Jul 2021 19:30:09 -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=L9umgiQf; 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 S234108AbhGJCbH (ORCPT + 99 others); Fri, 9 Jul 2021 22:31:07 -0400 Received: from mail.kernel.org ([198.145.29.99]:43192 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234006AbhGJC2M (ORCPT ); Fri, 9 Jul 2021 22:28:12 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 1ED8F61416; Sat, 10 Jul 2021 02:25:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1625883905; bh=cjFLiYvpXgJg5R8/A0oRgy/TxHOhY+yBWW71dNTeMZw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=L9umgiQfqrdqTdzF5zKmfjDNWNmalbjvbGnfZ3ByVawwYj22L6ltxIGhrhkKZlroi EMCsUyxkCB/cgMQG1QiQ/gt9pA81ttwhdTavIl6dAoWjECUijyBxJySYdROYQEps/a 5F1w/ooMrAUCIEEZIDJ4vBq0l+OyiPLFkneNhKz4EJd703iUZZPZkautWB8NG+f1Ge dxSKhTTkEq8P5/T8jq8ZHBfI047Jpk303Uvr+3gszAtpZhOKyXKK8UqOV+lx6RQqlz hlsUiGBI30Laf8Tbqlf39J/Drbpwqy/8A9zdKX1ee+8pdjbJG9ZXHZ3WPhjILpqpJ8 AkHoeKw4LLMuQ== 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 5.10 28/93] ALSA: ac97: fix PM reference leak in ac97_bus_remove() Date: Fri, 9 Jul 2021 22:23:22 -0400 Message-Id: <20210710022428.3169839-28-sashal@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210710022428.3169839-1-sashal@kernel.org> References: <20210710022428.3169839-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 7985dd8198b6..99e1728b52ae 100644 --- a/sound/ac97/bus.c +++ b/sound/ac97/bus.c @@ -520,7 +520,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