Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3938657pxj; Mon, 21 Jun 2021 09:47:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyLFqfNCSKopSBFyCQVG/ILGBF6mFJ0/BSDticG0pD1UtITBoebjy1cyNB8+FgyUK/tGlCL X-Received: by 2002:aa7:cb90:: with SMTP id r16mr22827688edt.121.1624294034877; Mon, 21 Jun 2021 09:47:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624294034; cv=none; d=google.com; s=arc-20160816; b=M09k38/dZyW4ym9k+pBO4jFdBx0dSUk0Re9pTxKmUAUzMqrKqxHc1+I+juCGNRdQEk uGt6gWb+4hI2IjzUiaifpSFCBLTSEXGAaAwKmYz1QdTshaWLCvDQzNXGCp1wgqETHDpx dWxCKLX+7w3VrDpiWl3EGwldGNsFhOPypxijthV65EUSPHDYst4kxZxnF6Upds6Nqjs8 CE4//Ff5QHeuuJN9XV3YFCEXCOnbJy0+AKbrT1xWnwL0kOcbIDZMVv5Vk8EuD1OloCnD cNw5JjkayRICDFlEve013dsmoyEx9ba4jLQoe3XUmT9w8VUmMsM8cwjcL7kmHmsAllgE 0TjA== 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=eVYwBOAOTAkGv39WLZJnWJZXfM5fxMMj7Ycz5FsIarI=; b=Eqy4A8Gkmxi2QvOhasBFlztbe8JhexEWYu4GbbJvvi3y637qpgELb5zd4s1FNTF54g lXLuh/VuiiKNmMOD7MgW+0NNsEUt9ZvdzaR70QnTLIDOPy9EVBQ6Nt+Aa/091NPK68KL RJZB+vD1/gUg+eLtxd3v89USPdS7jkpXUHSga9jEfI3Mf7O+NXIcQl/+BnINadkuLDm4 UDhd6eE/aH+HrD/j2i6xEQAqo/oPk9KfcWJDjFTFsR7KkHrlSCImjzHlcpm+trLOTjAQ qSzSOMZkX8NXF+7G2Wh1dTRXZ9aSpxlmSA/vcEefIwXjhXaEYxiqbvCSxGSDDafixf4f YUxg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=q8KmYEKy; 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 hw6si3400553ejc.395.2021.06.21.09.46.52; Mon, 21 Jun 2021 09:47:14 -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=q8KmYEKy; 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 S231536AbhFUQsE (ORCPT + 99 others); Mon, 21 Jun 2021 12:48:04 -0400 Received: from mail.kernel.org ([198.145.29.99]:33914 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233241AbhFUQnm (ORCPT ); Mon, 21 Jun 2021 12:43:42 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 363F461448; Mon, 21 Jun 2021 16:31:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1624293105; bh=/4qA9Gz7Yw2MDT2xfMW43+5+10S3nLL/FwGV37M7M2k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=q8KmYEKyPXX91Zqd/DgESqW5A+vH4Um7NwZv3OOYSktnh5xwEBc/woe7CSlcSDwKo d5dCRjmC08BYcToG85ylGYVPtxiA13CAHlsepfoZxZNcsuF8i7hvAPwbVpKYOmSACU cYNaxAqq27sPMrJLbbPOiSaqOVzl7VbP9WNuF6Hw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, kernel test robot , Dan Carpenter , Tiezhu Yang , Chunfeng Yun , Vinod Koul , Sasha Levin Subject: [PATCH 5.12 093/178] phy: phy-mtk-tphy: Fix some resource leaks in mtk_phy_init() Date: Mon, 21 Jun 2021 18:15:07 +0200 Message-Id: <20210621154925.892843797@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210621154921.212599475@linuxfoundation.org> References: <20210621154921.212599475@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: Tiezhu Yang [ Upstream commit aaac9a1bd370338ce372669eb9a6059d16b929aa ] Use clk_disable_unprepare() in the error path of mtk_phy_init() to fix some resource leaks. Reported-by: kernel test robot Reported-by: Dan Carpenter Signed-off-by: Tiezhu Yang Reviewed-by: Chunfeng Yun Link: https://lore.kernel.org/r/1621420659-15858-1-git-send-email-yangtiezhu@loongson.cn Signed-off-by: Vinod Koul Signed-off-by: Sasha Levin --- drivers/phy/mediatek/phy-mtk-tphy.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/phy/mediatek/phy-mtk-tphy.c b/drivers/phy/mediatek/phy-mtk-tphy.c index cdbcc49f7115..731c483a04de 100644 --- a/drivers/phy/mediatek/phy-mtk-tphy.c +++ b/drivers/phy/mediatek/phy-mtk-tphy.c @@ -949,6 +949,8 @@ static int mtk_phy_init(struct phy *phy) break; default: dev_err(tphy->dev, "incompatible PHY type\n"); + clk_disable_unprepare(instance->ref_clk); + clk_disable_unprepare(instance->da_ref_clk); return -EINVAL; } -- 2.30.2