Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp9109956pxu; Mon, 28 Dec 2020 06:54:18 -0800 (PST) X-Google-Smtp-Source: ABdhPJw4B3qEXn6ZQfQNN4XrGYyjkJFJ9PKvNaxgmRQNBBNC1JH7YK82matl9Oll8R7i/6zPGPbt X-Received: by 2002:aa7:cd63:: with SMTP id ca3mr40378398edb.164.1609167258540; Mon, 28 Dec 2020 06:54:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609167258; cv=none; d=google.com; s=arc-20160816; b=Tq2nLAUCMMZltINmqN0ywWlICSO5ZCxFDb/gDssa4HCz54jHJAouQ9BeB2Xn6US2P5 Bi3idQUF7jrsBUI8jxJsMcNXe3d2OYBkrJIxzkH0N2pQhvTNRc0HSA12kk2UiGz5Kmx3 Gcgo3zJKHxrkwEOBF8qsPUl3idXugZn9Suv6HZ+zWGMCYY6cSkqgNcUhlcd8CYoUkLi8 RY7d4pwYZwQjusLPOZZogxkoQhMCLDXuIHyTB13krX2M1tlg1Lqfc2KbzE5Av09D1Dda hDj+NEDpve1kuPYn+D7Nb/jK9RM+xGl5Agwug20eOE19m9lbRZe+je/DYg22oCwz2Cn8 FEPw== 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=rrMjrKhnyBtOA84+A2JH1YI5ebxwicPybhqXCf2T5jI=; b=yCpiczCYaMasf6Z6p2CjbnA50XO4Lbjo4UpcDCRzKSThjAHxZ63anuf2Vf/xHEMFjF +C4wiUN5ddhblYlBtrHpVIDulMpriAJrZl4C4HhXuVGW8+GQKAen2HmmPPmgJTNwaDfJ eyGUAIc76qoZNPSe0vz94j/NSRNVOcbK+5KZ5GmaqAtNLxNfqo/fnM7kAtvfCdIKbuDx XmsuPrAOl9qxlYuHflug9pRIufW6m3oHFcPelrrsTimHoTv8nOG4AoctwKw04aXqVjj+ xJ1fIJCBqULrQAAgq4wFekqNxKR9gVrrR0HtE+sT9o3Fj9Z9ktPxSeUD5PdsobrfQuRL XKOw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=fuInG9wy; 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 s3si20182825edy.134.2020.12.28.06.53.54; Mon, 28 Dec 2020 06:54:18 -0800 (PST) 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=fuInG9wy; 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 S2502048AbgL1OwG (ORCPT + 99 others); Mon, 28 Dec 2020 09:52:06 -0500 Received: from mail.kernel.org ([198.145.29.99]:53606 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2502029AbgL1OSy (ORCPT ); Mon, 28 Dec 2020 09:18:54 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id C9F9B206D4; Mon, 28 Dec 2020 14:18:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1609165113; bh=nGCLY8IT6dAMWqZXpIhlhyg/Rhh9fWVJzV5hz+KEYQE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fuInG9wyxq98g9H3fLXH9zG0Wj83ox3N0Et/IfCHxxE035hC2V33Fw2xYIU9aeNoR KTpeICG35cM8R35uzymFDMOWE9O21/8cLiLGe1z26PmM1QnUcpDcBHTW4X/TspvOF4 gMRNa0w0dcir1PTfXtSG82DK30L+YLYKdn4fmU68= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dan Carpenter , Miquel Raynal , Sasha Levin Subject: [PATCH 5.10 409/717] mtd: rawnand: meson: Fix a resource leak in init Date: Mon, 28 Dec 2020 13:46:47 +0100 Message-Id: <20201228125040.575969990@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201228125020.963311703@linuxfoundation.org> References: <20201228125020.963311703@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: Dan Carpenter [ Upstream commit ad8566d3555c4731e6b48823b92d3929b0394c14 ] Call clk_disable_unprepare(nfc->phase_rx) if the clk_set_rate() function fails to avoid a resource leak. Fixes: 8fae856c5350 ("mtd: rawnand: meson: add support for Amlogic NAND flash controller") Signed-off-by: Dan Carpenter Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/X8ikVCnUsfTpffFB@mwanda Signed-off-by: Sasha Levin --- drivers/mtd/nand/raw/meson_nand.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/mtd/nand/raw/meson_nand.c b/drivers/mtd/nand/raw/meson_nand.c index 48e6dac96be6d..1fd7f7024c0b4 100644 --- a/drivers/mtd/nand/raw/meson_nand.c +++ b/drivers/mtd/nand/raw/meson_nand.c @@ -1044,9 +1044,12 @@ static int meson_nfc_clk_init(struct meson_nfc *nfc) ret = clk_set_rate(nfc->device_clk, 24000000); if (ret) - goto err_phase_rx; + goto err_disable_rx; return 0; + +err_disable_rx: + clk_disable_unprepare(nfc->phase_rx); err_phase_rx: clk_disable_unprepare(nfc->phase_tx); err_phase_tx: -- 2.27.0