From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5E41E53B4 for ; Sun, 17 Sep 2023 19:35:39 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B9B69C433C8; Sun, 17 Sep 2023 19:35:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1694979339; bh=XIHlnsQW4DWtU3JGp7kgAQFr370TeOpWNjrf+7dqtx8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=2FGxCYRB3A9FBo+E8PYM0hzzLaNadmqh+hKpjXfBGb5Tjvci0LYXCzlaCG89PH7hT pEJjo1CFtY65NcHsN54xtDiHZm+dvkYVN3uIrHqfFWPYVmpJrUxmTBWcxxFNpoEdIn k8QSN7HVgTOQ+a7UM1BLieubz4wnvT6032ZScu7A= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Yi Yang , Sasha Levin Subject: [PATCH 5.10 247/406] serial: tegra: handle clk prepare error in tegra_uart_hw_init() Date: Sun, 17 Sep 2023 21:11:41 +0200 Message-ID: <20230917191107.683993510@linuxfoundation.org> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20230917191101.035638219@linuxfoundation.org> References: <20230917191101.035638219@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 5.10-stable review patch. If anyone has any objections, please let me know. ------------------ From: Yi Yang [ Upstream commit 5abd01145d0cc6cd1b7c2fe6ee0b9ea0fa13671e ] In tegra_uart_hw_init(), the return value of clk_prepare_enable() should be checked since it might fail. Fixes: e9ea096dd225 ("serial: tegra: add serial driver") Signed-off-by: Yi Yang Link: https://lore.kernel.org/r/20230817105406.228674-1-yiyang13@huawei.com Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- drivers/tty/serial/serial-tegra.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/tty/serial/serial-tegra.c b/drivers/tty/serial/serial-tegra.c index 62377c831894d..fac4d90047b03 100644 --- a/drivers/tty/serial/serial-tegra.c +++ b/drivers/tty/serial/serial-tegra.c @@ -994,7 +994,11 @@ static int tegra_uart_hw_init(struct tegra_uart_port *tup) tup->ier_shadow = 0; tup->current_baud = 0; - clk_prepare_enable(tup->uart_clk); + ret = clk_prepare_enable(tup->uart_clk); + if (ret) { + dev_err(tup->uport.dev, "could not enable clk\n"); + return ret; + } /* Reset the UART controller to clear all previous status.*/ reset_control_assert(tup->rst); -- 2.40.1