From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 02459C433E0 for ; Thu, 18 Jun 2020 12:33:15 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BEBDA20707 for ; Thu, 18 Jun 2020 12:33:14 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="HI5l48ZM" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BEBDA20707 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=sntech.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Uw0BZQ+e2WoYw2WXDHtu17MyWoeun6HB32c1loD4BZ0=; b=HI5l48ZMH+Xfhw qzdDcTfo2hSHO9v4vzznI4/ckCRcCkrUN36afDb0eRyUDg5q+Tg+uiF1QitwMUEU6E3/lGktyg6RO a9brCJudxDh85zh514ZlwaFm76D1YJUYHR1dva67OiHQaApL0FR9FiMYRSlHimnHvVNx9Pzi1JBQs cXhMRhUXbzr5UEhMnIUrpu7LmVsnsMUmX2wn5M1dAgSjKA8C+uYPHdUFyZFEskDl8JoBQ6ehqEaIU LiReUPDkmJWDXY912TXpUQgAgZhAmsabF4XgBGLt53K3rVBGdyfvP+hjbwz1ZEolGaoZfC+JOpUC2 37l2Dv4N5HnUWMdVwAuw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jltjG-0004IV-3O; Thu, 18 Jun 2020 12:33:14 +0000 Received: from gloria.sntech.de ([185.11.138.130]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jltiV-0003lu-TM; Thu, 18 Jun 2020 12:32:43 +0000 Received: from ip5f5aa64a.dynamic.kabel-deutschland.de ([95.90.166.74] helo=diego.localnet) by gloria.sntech.de with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jltiJ-00082t-U1; Thu, 18 Jun 2020 14:32:15 +0200 From: Heiko =?ISO-8859-1?Q?St=FCbner?= To: wu000273@umn.edu Subject: Re: [PATCH] ASoC: rockchip: Fix a reference count leak. Date: Thu, 18 Jun 2020 14:32:15 +0200 Message-ID: <3050852.oyibrqGndV@diego> In-Reply-To: <20200613205158.27296-1-wu000273@umn.edu> References: <20200613205158.27296-1-wu000273@umn.edu> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200618_053228_017780_B855D457 X-CRM114-Status: GOOD ( 15.28 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, kjlu@umn.edu, Takashi Iwai , Liam Girdwood , Sugar Zhang , linux-rockchip@lists.infradead.org, Mark Brown , Jaroslav Kysela , linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org Am Samstag, 13. Juni 2020, 22:51:58 CEST schrieb wu000273@umn.edu: > From: Qiushi Wu > > Calling pm_runtime_get_sync increments the counter even in case of > failure, causing incorrect ref count if pm_runtime_put is not called in > error handling paths. Call pm_runtime_put if pm_runtime_get_sync fails. > > Fixes: fc05a5b22253 ("ASoC: rockchip: add support for pdm controller") > Signed-off-by: Qiushi Wu somewhat unintuitive, but I checked __pm_runtime_resume for it, so Reviewed-by: Heiko Stuebner > --- > sound/soc/rockchip/rockchip_pdm.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/sound/soc/rockchip/rockchip_pdm.c b/sound/soc/rockchip/rockchip_pdm.c > index 7cd42fcfcf38..1707414cfa92 100644 > --- a/sound/soc/rockchip/rockchip_pdm.c > +++ b/sound/soc/rockchip/rockchip_pdm.c > @@ -590,8 +590,10 @@ static int rockchip_pdm_resume(struct device *dev) > int ret; > > ret = pm_runtime_get_sync(dev); > - if (ret < 0) > + if (ret < 0) { > + pm_runtime_put(dev); > return ret; > + } > > ret = regcache_sync(pdm->regmap); > > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel