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=-18.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT 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 40BB2C4332B for ; Mon, 1 Mar 2021 18:17:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1D94D64F2A for ; Mon, 1 Mar 2021 18:17:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239569AbhCASRU (ORCPT ); Mon, 1 Mar 2021 13:17:20 -0500 Received: from mail.kernel.org ([198.145.29.99]:60800 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239057AbhCASJT (ORCPT ); Mon, 1 Mar 2021 13:09:19 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id A1F8F64F3E; Mon, 1 Mar 2021 17:05:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1614618357; bh=JxfD2xSjmuUV9FC76sMH0DWAc9vUOhn/rSQ2t0OJ/V8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=E9y56WaWt5tlVyDhEhJz5U2gL1M8kn3aLxGfWygU3hEZLDhiZRfrmRR9YqVlc1YNA BuhYRO1M6JOFQOvV1FcAoPg4iGjgvUGedo6PezM0ndJlVBRcbAUtSmv5Y8KmF9tgG2 nxBAQpNO7UXoN8kJnNmElINiZgEV+6eZTzWqZyQc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Christophe JAILLET , Santosh Shilimkar , Sasha Levin Subject: [PATCH 5.10 057/663] soc: ti: pm33xx: Fix some resource leak in the error handling paths of the probe function Date: Mon, 1 Mar 2021 17:05:05 +0100 Message-Id: <20210301161144.578332479@linuxfoundation.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210301161141.760350206@linuxfoundation.org> References: <20210301161141.760350206@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: stable@vger.kernel.org From: Christophe JAILLET [ Upstream commit 17ad4662595ea0c4fd7496b664523ef632e63349 ] 'am33xx_pm_rtc_setup()' allocates some resources that must be freed on the error. Commit 2152fbbd47c0 ("soc: ti: pm33xx: Simplify RTC usage to prepare to drop platform data") has introduced the use of these resources but has only updated the remove function. Fix the error handling path of the probe function now. Fixes: 2152fbbd47c0 ("soc: ti: pm33xx: Simplify RTC usage to prepare to drop platform data") Signed-off-by: Christophe JAILLET Signed-off-by: Santosh Shilimkar Signed-off-by: Sasha Levin --- drivers/soc/ti/pm33xx.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/soc/ti/pm33xx.c b/drivers/soc/ti/pm33xx.c index d2f5e7001a93c..dc21aa855a458 100644 --- a/drivers/soc/ti/pm33xx.c +++ b/drivers/soc/ti/pm33xx.c @@ -536,7 +536,7 @@ static int am33xx_pm_probe(struct platform_device *pdev) ret = am33xx_push_sram_idle(); if (ret) - goto err_free_sram; + goto err_unsetup_rtc; am33xx_pm_set_ipc_ops(); @@ -566,6 +566,9 @@ static int am33xx_pm_probe(struct platform_device *pdev) err_put_wkup_m3_ipc: wkup_m3_ipc_put(m3_ipc); +err_unsetup_rtc: + iounmap(rtc_base_virt); + clk_put(rtc_fck); err_free_sram: am33xx_pm_free_sram(); pm33xx_dev = NULL; -- 2.27.0