From patchwork Mon Oct 5 15:26:46 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 268119 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=-13.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, 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 DD0C3C4363D for ; Mon, 5 Oct 2020 15:40:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 962F82075A for ; Mon, 5 Oct 2020 15:40:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1601912412; bh=ZQme0Sb5Y/n41RlYjxkPOpk4pvn9kOjdIlXsph5hS74=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=OBlEgqvhTA+0iz06IgDaZPyCRWZSb+6Y3HkzXqejfEY1Rk5fNfduTpT9v2Dirl9+k t9ls6YV7DJZ4hdNR8U9nGbVWty/z2alz/vr1j7EtNJjwKA+ma1rkjPoEm/llYrqwEn 65iDV2737Vj1K2xoQFpx1tzwCk+IbziOl/gFZsv0= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727645AbgJEPkM (ORCPT ); Mon, 5 Oct 2020 11:40:12 -0400 Received: from mail.kernel.org ([198.145.29.99]:55690 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727660AbgJEP3j (ORCPT ); Mon, 5 Oct 2020 11:29:39 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 625CF2074F; Mon, 5 Oct 2020 15:29:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1601911778; bh=ZQme0Sb5Y/n41RlYjxkPOpk4pvn9kOjdIlXsph5hS74=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OUhWVye0tXC/SY1Win9efMq+wz9hd4/d6nD/hQ73XTTuHKaqoT/NPnClUYrEnEk/c vtJV2aIug+rVSBA/WMOG5YjKLaSvRQsIkYJ19FABW2U45VrxrEJH/5Iyufx9jAiPjh tnXOOMaOgOJIatBvzgymmH1WZeey1UxlEd0S7QhI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dan Carpenter , Vinod Koul , Sasha Levin Subject: [PATCH 5.4 34/57] phy: ti: am654: Fix a leak in serdes_am654_probe() Date: Mon, 5 Oct 2020 17:26:46 +0200 Message-Id: <20201005142111.452008304@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201005142109.796046410@linuxfoundation.org> References: <20201005142109.796046410@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Dan Carpenter [ Upstream commit 850280156f6421a404f2351bee07a0e7bedfd4c6 ] If devm_phy_create() fails then we need to call of_clk_del_provider(node) to undo the call to of_clk_add_provider(). Fixes: 71e2f5c5c224 ("phy: ti: Add a new SERDES driver for TI's AM654x SoC") Signed-off-by: Dan Carpenter Link: https://lore.kernel.org/r/20200905124648.GA183976@mwanda Signed-off-by: Vinod Koul Signed-off-by: Sasha Levin --- drivers/phy/ti/phy-am654-serdes.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/phy/ti/phy-am654-serdes.c b/drivers/phy/ti/phy-am654-serdes.c index 88a047b9fa6fa..6ef12017ff4e8 100644 --- a/drivers/phy/ti/phy-am654-serdes.c +++ b/drivers/phy/ti/phy-am654-serdes.c @@ -625,8 +625,10 @@ static int serdes_am654_probe(struct platform_device *pdev) pm_runtime_enable(dev); phy = devm_phy_create(dev, NULL, &ops); - if (IS_ERR(phy)) - return PTR_ERR(phy); + if (IS_ERR(phy)) { + ret = PTR_ERR(phy); + goto clk_err; + } phy_set_drvdata(phy, am654_phy); phy_provider = devm_of_phy_provider_register(dev, serdes_am654_xlate);