From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1FC7FCE79CE for ; Wed, 20 Sep 2023 12:36:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235854AbjITMgV (ORCPT ); Wed, 20 Sep 2023 08:36:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51826 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234920AbjITMgT (ORCPT ); Wed, 20 Sep 2023 08:36:19 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D6668DD for ; Wed, 20 Sep 2023 05:36:08 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EA9F8C433CA; Wed, 20 Sep 2023 12:36:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1695213368; bh=2oBxsyESmxgjchCMy7d9QG5smXbYDKJ1xUOYyBL7Sp0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ElrBSDMda9tVJBYUCJyhyq7ru6rnblAMesGH3Jg/mUDjLjwu0+xd5WFrVoxeIyvZV lRy5OMXr3nzZCp64WqAWOyJsFDrR53IeBSam0pATQZBSk8boNYH1V6DFuK5a9v2psY oQ0ccOMLsIpiJdVFvfoKt8CQeDtuxRaljsUIiLI8= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Yi Yang , Sasha Levin Subject: [PATCH 5.4 186/367] serial: tegra: handle clk prepare error in tegra_uart_hw_init() Date: Wed, 20 Sep 2023 13:29:23 +0200 Message-ID: <20230920112903.449357219@linuxfoundation.org> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20230920112858.471730572@linuxfoundation.org> References: <20230920112858.471730572@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org 5.4-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 7930f2a81b4c1..2b5d26df5fcfc 100644 --- a/drivers/tty/serial/serial-tegra.c +++ b/drivers/tty/serial/serial-tegra.c @@ -1000,7 +1000,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