Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp1144813pxv; Fri, 9 Jul 2021 19:26:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyRiBpHqSqJAvYLFEw1J8+3es2BWKYqPSI9mbeMP5vsWZAkn/E2PL0f8tCwYU12oA/5nc4q X-Received: by 2002:a05:6402:1001:: with SMTP id c1mr50410981edu.26.1625883965735; Fri, 09 Jul 2021 19:26:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625883965; cv=none; d=google.com; s=arc-20160816; b=pXJHTM3nGCYqM9lFk7vdoIS3FerNM59TyhInrAFFnOSx84IXatv11mWvVPaMi5K/2A kQGCtCGcO1lXBjAhtxfNkUx2T1K1rAZ1q+gxSPNiwpJosTNy6Oh2uiKK0lkEPrIf1dhZ mDCnMjPHUgCq/lXHtruZPHL8jTDZCgo+9vOFikLRb21IliADu3IyMynCFQRXhQ7+Z0QJ 5mem60ZQwNH4UFOA3pyZjTz01ALikuxVXehVtlN9j2RFQU3xt1qTDwHpzYkAk+k2kYyJ UOPdCTyiv+c9oADePePEm/dVEQTqEB6gd0/4jVmEbb/OwehnQqlYi42dF8bFfWGx/Gvx 8TAQ== 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=lI7IcPhwkA1MSkC230Fio/iU/o9QSMduuipFKmZ6kB4=; b=DkxMlQ7q2G2L9PprToAOSccdOqYgpuNJnC+1zCqnykEV2XVVdJR15aKEUyWUifYpOX d/c9MssSXNwRAtvHtTTrY3ASuEqkBK4Vl1PsGjB5sSvTZE8A7alK8DEB5Vw4fTHy4SEf oYAz3YcfVmEpAqQwQlcebLQh4ug+wLAbCM7e8ravnT8tIAcmc7OCDtIwxbPQ+drILtHG jF78VMX1nkw2Py1XUedWdtLfb3ELeY4/H2VlzG0T3Qw9aKOVCUw5j0CXtPqCkoLdWQJ3 /IghIb7yCQanYEqNwP2CsHXX28MBOEGtMmjt87/FQ+aABkewtvvMTxn2FaIol0q6tv+2 e/IA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="hOEpe/Hu"; 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 o27si5890126ejb.629.2021.07.09.19.25.42; Fri, 09 Jul 2021 19:26:05 -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="hOEpe/Hu"; 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 S233270AbhGJC0u (ORCPT + 99 others); Fri, 9 Jul 2021 22:26:50 -0400 Received: from mail.kernel.org ([198.145.29.99]:43180 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233335AbhGJCZt (ORCPT ); Fri, 9 Jul 2021 22:25:49 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 22F68613EC; Sat, 10 Jul 2021 02:23:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1625883782; bh=1tBw5Zt9YPIrQK/9dRp5GoREl6y7xA8VRfsxmcF8F8I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hOEpe/HulsGkBKcjfy/0WvTWFGdB5J+x+BKAE7nOJFPBA01MWlWjlvrkKn6iDcvPK HrQB48wpBk/AOJeil6GgYO2t4m7VZ1G1atF2NDXe9XThCUskB7cEqzKDxj9fYPxRq8 T7+XNhlarJ4jef3McBtnGbOv/6jBYEp+Z1oWgTw/edCAdFy1k/SsATd7XmJjaAqASV arymNa7lcCkFG8nGC/QqGWDXoXPtbNQMtb9S3tDym+TTkPiRJWOzXwhXayoSMsAjDW RG6j3OgJu+GXxFBy0gjZsziNhK3bJLBBU+NNvGdAS6ZSeUMgFCUwcAvlS08UYSGZNm fHldJUL+8Ck1w== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Yufen Yu , Hulk Robot , Mark Brown , Sasha Levin , alsa-devel@alsa-project.org Subject: [PATCH AUTOSEL 5.12 050/104] ASoC: img: Fix PM reference leak in img_i2s_in_probe() Date: Fri, 9 Jul 2021 22:21:02 -0400 Message-Id: <20210710022156.3168825-50-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 81aad47278539f02de808bcc8251fed0ad3d6f55 ] 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/20210524093521.612176-1-yuyufen@huawei.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/img/img-i2s-in.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/soc/img/img-i2s-in.c b/sound/soc/img/img-i2s-in.c index 0843235d73c9..fd3432a1d6ab 100644 --- a/sound/soc/img/img-i2s-in.c +++ b/sound/soc/img/img-i2s-in.c @@ -464,7 +464,7 @@ static int img_i2s_in_probe(struct platform_device *pdev) if (ret) goto err_pm_disable; } - ret = pm_runtime_get_sync(&pdev->dev); + ret = pm_runtime_resume_and_get(&pdev->dev); if (ret < 0) goto err_suspend; -- 2.30.2