Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3929951pxj; Mon, 21 Jun 2021 09:35:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwmIoAoOHN+sPQywNxALu9aX6oS9y+B8urG2BBBJl2TjSTCaGSx5JXRs3mIvLkhoH18bDGk X-Received: by 2002:a17:906:85b:: with SMTP id f27mr6667716ejd.50.1624293347121; Mon, 21 Jun 2021 09:35:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624293347; cv=none; d=google.com; s=arc-20160816; b=EXs/XuHCCRktXqoLrQv87fEnXQpNOOJWVvzR5Qm0lRtGtFU+JJ7e4cSHO54WUcuLo7 RmSnzrNdHKtFARD9tbPjieInCqrX3CF/PEVWFoA/nFY/QWcNLd2Gxp2k5Y6JeJd8tueS bmjSUxSp4Xkw/VX6BDfpDIuxZCrmVSBeUEvB3qKN0k79Jphe4gQfMzpDynICOhqVYR9Y IGETdyKhxbgSwUWL2pftXwYiY006TrPX+2df+ZA8SV8ZZPqm37gJniPTjgQpZpLgKEAq jgAWvMSL+j1cOSYIEcVJquXjMlPeqUK9RaoDZxLufDfKyu7PQJKzbM9bcF1nDtsuFexf Yukw== 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=vRyMyonuURg6St2VUUUJDBjycLeCDrsX+EqXT/qq8KWdW2B04TBxdLvSnmnYlnn+8w z1ipsQzjaubefb9NHd3sRdvXg/9PyysrGe3Ky6DGjoXSZnRPk6LCR3uH7W1tOIt7LMgO NTmiVB7XkyIZdIl6x1iuQXAcshKZMPNltLYfRZEClp0LUnrn7agITeD3OJqxWB8bOC0z PJTcXB7IGvxPM8rYXl8mmk1052i24E+UmkwrSUcWqDSTcsLBMLmvUQuzFCJLJkmDSAKs HzPDjh2ihlrpu/vgXNf/Q1n2hpPBPALlFCUpmBF+/xKy0mC6Q5VCEN5DPRNwgIBKXh4F V1cQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=URu1oYKv; 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 15si6310563ejl.590.2021.06.21.09.35.24; Mon, 21 Jun 2021 09:35:47 -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=URu1oYKv; 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 S232447AbhFUQgm (ORCPT + 99 others); Mon, 21 Jun 2021 12:36:42 -0400 Received: from mail.kernel.org ([198.145.29.99]:55922 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231563AbhFUQdF (ORCPT ); Mon, 21 Jun 2021 12:33:05 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 30258613C8; Mon, 21 Jun 2021 16:26:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1624292767; bh=/4qA9Gz7Yw2MDT2xfMW43+5+10S3nLL/FwGV37M7M2k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=URu1oYKviZzbXV0UW70U33XbPyBpx3hrAWUMlNyWX7yEsmwMcIJlVvZ8RigH+4eTi ck56SLAWL70kdC5hY/Bkhui9MW8/M5eiepoAcxwaLaSJq18JrfelXAD8DxRRMn20kt INjRF4SbLDC2o3DUejHEC0fLqf32nVgmvUsqjvZQ= 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.10 079/146] phy: phy-mtk-tphy: Fix some resource leaks in mtk_phy_init() Date: Mon, 21 Jun 2021 18:15:09 +0200 Message-Id: <20210621154915.981812365@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210621154911.244649123@linuxfoundation.org> References: <20210621154911.244649123@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