Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp1145484pxv; Fri, 9 Jul 2021 19:27:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJybKmiUnjl1e7FT6TWQaffjoBVZiWw7OXhw2SIkXd2O13hX0043/qistdCoDaPH8Mslc7Yk X-Received: by 2002:a17:907:d24:: with SMTP id gn36mr40389825ejc.269.1625884055820; Fri, 09 Jul 2021 19:27:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625884055; cv=none; d=google.com; s=arc-20160816; b=DMCZFQc53+XLC/wa+pVSW9B4w88dkOSCqOuIRzEK5L/qKcrA+75/KjiW4rGBE0UJh3 5TzU3yNbrkAjPSOI5GBy+zjji1QJoKBogpqPk3loeEVmpTZbv+rVCXggTezMz8TZGJCP OrWUn0sdq/MVyTU00PzwMoGFk1N/0mjIlV4ZUcnCrYFjKqDSPl96I4Y4sWPJ0QdVWYzV fX7Fs4gV+VT/IdV0mZAb64YCsUEFjeCTGp8z2P2GMFBMNwDvR/HZH0kdmAlf0YS7NaiB WcRm/mBLZuheApMsQRzYOclK37kE/YVXOoZjePmYZZRKVp0PxQB95Wc214zW2CU3oY6z nWfQ== 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=hifnWDu6uyHfe0evcH8M7RL099sRvuq+vwk3RVOgUoA=; b=ZPEHME/ao0xtNNDIJaXGZE0RlXjboGGrl8w1u1+lJ0Fy7fwuuForE8mrRjrKN/Ayw3 AyJYYG60c5e0uvEM7eRpivNWE/2NhLYG7nadbwd/5JwlnQkvdvihzBLjt1S7iaBAqdp1 nLe5a8dzrI6vrdawUm27PMLdUAQ3d9NQFx+QSa13jlvS/P5DAbX3uqKmIFcpmaurevPu jzxMLUdoSkKfuQnXtkVj44Ur6+jJa3569/DdpNXljAEUZuh1LgVnvurhhNVRgbkgFhQx kegOsVfINGRvsdlih3SbmxoUXLGdt1AGoToQ8bnkzWUdownpsGDNrBG6NNE5lNhN0XNX SB7g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=k6NI+Kkf; 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 e11si9117761edz.140.2021.07.09.19.27.12; Fri, 09 Jul 2021 19:27:35 -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=k6NI+Kkf; 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 S233417AbhGJC0A (ORCPT + 99 others); Fri, 9 Jul 2021 22:26:00 -0400 Received: from mail.kernel.org ([198.145.29.99]:42072 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232394AbhGJCZT (ORCPT ); Fri, 9 Jul 2021 22:25:19 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id A349F613C3; Sat, 10 Jul 2021 02:22:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1625883755; bh=psjiZPoJqTbIx9wY8pQaLI33HJVWFseOA6R/5ygYdO4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=k6NI+KkfrBIHJuOy6BQjE1eXy+a32PC1SStf++dDIiWG5GJw8Yzm++FbzhmscTHHJ f+r/axvxL3g0/ppjpalCosl4STMoWgKrbNgxaiNu0hNWfT+Itre5XyB9xELETXQlVP 5RA4CKk0xHxgG6Wzgsz4C09rK3sOhrzn/+XRtWZpGcIiuyn4YoNlnEdqXflMiaCvDI HZ0JgrQyDwjA1ez8SNsvju6HOOMIwKUklTW7R2lhnbX4aD6ozeDFlIlqO/DwAGNuB6 dO8QHG5GdAs4SqX7FYqEzyouikvAHMIlf2vgBVdYvyI1JPnLTmiByKNQTJwXFFfgSz aOmdIjP6QhXWA== 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.12 030/104] ALSA: ac97: fix PM reference leak in ac97_bus_remove() Date: Fri, 9 Jul 2021 22:20:42 -0400 Message-Id: <20210710022156.3168825-30-sashal@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210710022156.3168825-1-sashal@kernel.org> References: <20210710022156.3168825-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 d9077e91382b..6ddf646cda65 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