Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2476453pxj; Mon, 10 May 2021 04:02:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxZ7Z/3kF3+vw7SWljLvz1I0UVAipOPWwxyTNOxeQxDsiqnTaP+Ed3P5OHe75Je4IsPksG8 X-Received: by 2002:a05:6638:3bc:: with SMTP id z28mr20699861jap.133.1620644575196; Mon, 10 May 2021 04:02:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620644575; cv=none; d=google.com; s=arc-20160816; b=MbwqpgOOWrRLiPebf5raVo40x23rud/+QMP4NGvqXrw/Op4CJqdQ/cCg9DZqJR+AXS ea32Zwp3md3QjPpDQX8SdJ4tzZdd62ZkWJOvUYziNNOd97Uha2suM2v0JddKUryBgjGE f+VERH4o6hl9WU2R8tTVYGKywFJFZYFwCHTej67o1iwIj3+/9a4GB3nvSKYjnb4XTQfH EB0vyM+lYMj7WJ93v50l9cFeqPu9HOZA09I/pZ9YPVudPWzf5bbjoECf0iq8GogCCLCc P9YqXVqW3jTCbJPWqTpEOksdNyQjLulgCAW6zdCe66iTyzfFq/D+e8p0knI5/mHD3+xR dO4Q== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=7C0X7avAb8+oEHJeESfKd9LSsskpb+5o4deWrRr8WGg=; b=cSMEheDmaIbQmohOk2/bbX9rNLmEXL/y45DFBi+TltaG406dc9ZNBFc/sch5y4dxxd GPMQ8C8GcM18MBzl3HohZJr8jpOyBbyDKzMsNRkBloijKi/1k4RpYuXRyRNg3iKoGVVI TR8/wuwTAUnDJ3RleGso6nWjEGb+LD3O9Ci6EqGUEjf23gFJgFoBk0PT4ImqcLD70Lmg KcBd3gpkiwZokfvNWEB4Jcr95ggoEJrA6J4u8HWKdkSFSbwAGimuPbuKuZAAWEt61N6y Yaovv2ph74ije47024pugrfiTV/I7WSEQ9JVZQv4/P27qaSyMU6heKaZMP2jVki1RZ5R J48g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=JvrXZ962; 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=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u12si17075146ilm.67.2021.05.10.04.02.37; Mon, 10 May 2021 04:02:55 -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=@linuxfoundation.org header.s=korg header.b=JvrXZ962; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235462AbhEJLBE (ORCPT + 99 others); Mon, 10 May 2021 07:01:04 -0400 Received: from mail.kernel.org ([198.145.29.99]:57152 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233219AbhEJKpV (ORCPT ); Mon, 10 May 2021 06:45:21 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 4672C61997; Mon, 10 May 2021 10:35:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1620642922; bh=nU8tlfbCQHVYyUEoVEf5q3PbiYVH4sQriJ9Bb+49ZKs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JvrXZ962kMfCm5mJCJMCvx5Xdoh1F0W1xhrjKx6a2ju6DkSZTOApMt3rySKW5iaWo G/lupRNXkEBz3rD03CNP0jIUySVRTRGrTvJ+m/Rov/Rnkz5+KyagiL0SPQR44NK1fg 1PGJuVd7nCTmx4yR7Eh+Lmd1G8cFxw6edwo6WBas= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Shixin Liu , Herbert Xu , Sasha Levin Subject: [PATCH 5.10 106/299] crypto: sa2ul - Fix PM reference leak in sa_ul_probe() Date: Mon, 10 May 2021 12:18:23 +0200 Message-Id: <20210510102008.438920871@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210510102004.821838356@linuxfoundation.org> References: <20210510102004.821838356@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Shixin Liu [ Upstream commit 13343badae093977295341d5a050f51ef128821c ] 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. Signed-off-by: Shixin Liu Signed-off-by: Herbert Xu Signed-off-by: Sasha Levin --- drivers/crypto/sa2ul.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/crypto/sa2ul.c b/drivers/crypto/sa2ul.c index eda93fab95fe..39d56ab12f27 100644 --- a/drivers/crypto/sa2ul.c +++ b/drivers/crypto/sa2ul.c @@ -2345,7 +2345,7 @@ static int sa_ul_probe(struct platform_device *pdev) dev_set_drvdata(sa_k3_dev, dev_data); pm_runtime_enable(dev); - ret = pm_runtime_get_sync(dev); + ret = pm_runtime_resume_and_get(dev); if (ret < 0) { dev_err(&pdev->dev, "%s: failed to get sync: %d\n", __func__, ret); -- 2.30.2