From nobody Fri Oct 24 10:10:32 2025 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 22426C2BB9D for ; Mon, 15 Aug 2022 22:32:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1350599AbiHOWcA (ORCPT ); Mon, 15 Aug 2022 18:32:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46778 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1350398AbiHOW0m (ORCPT ); Mon, 15 Aug 2022 18:26:42 -0400 Received: from sin.source.kernel.org (sin.source.kernel.org [IPv6:2604:1380:40e1:4800::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0F74F616E; Mon, 15 Aug 2022 12:45:20 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sin.source.kernel.org (Postfix) with ESMTPS id 9EC48CE1262; Mon, 15 Aug 2022 19:45:18 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id AF609C433D6; Mon, 15 Aug 2022 19:45:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660592717; bh=fo3ll5pcQBNpqpQas4n+4QsnziesAAEYRt8J1PUkuz0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=xcndvjRerDcrVbdnPzsLYD0iekEXt7HN5HFk9HUFei3JawrFwCltKyzjpRCSHDN9+ FLM3THnCk/LYxWZaSYKzuNvJyl0vTO9P+dQDmhUarYRXy+3vUh7ihevVRB/PcPvhTw bTZPXVLisFHkVdqplzgPo5xSSxG7Fd53Yy+a/jTo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Hulk Robot , Jiri Slaby , Yang Yingliang , Sasha Levin Subject: [PATCH 5.18 0835/1095] serial: pic32: fix missing clk_disable_unprepare() on error in pic32_uart_startup() Date: Mon, 15 Aug 2022 20:03:54 +0200 Message-Id: <20220815180503.873715086@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180429.240518113@linuxfoundation.org> References: <20220815180429.240518113@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Yang Yingliang [ Upstream commit 6f3cdf2bf1ba9b70de6c2921a415951a0d59873b ] Fix the missing clk_disable_unprepare() before return from pic32_uart_startup() in the error handling case. Fixes: 157b9394709e ("serial: pic32_uart: Add PIC32 UART driver") Reported-by: Hulk Robot Reviewed-by: Jiri Slaby Signed-off-by: Yang Yingliang Link: https://lore.kernel.org/r/20220525021204.2407631-1-yangyingliang@huaw= ei.com Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- drivers/tty/serial/pic32_uart.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/tty/serial/pic32_uart.c b/drivers/tty/serial/pic32_uar= t.c index e3535bd8c8a2..a967b586a0a0 100644 --- a/drivers/tty/serial/pic32_uart.c +++ b/drivers/tty/serial/pic32_uart.c @@ -427,7 +427,7 @@ static int pic32_uart_startup(struct uart_port *port) if (!sport->irq_fault_name) { dev_err(port->dev, "%s: kasprintf err!", __func__); ret =3D -ENOMEM; - goto out_done; + goto out_disable_clk; } irq_set_status_flags(sport->irq_fault, IRQ_NOAUTOEN); ret =3D request_irq(sport->irq_fault, pic32_uart_fault_interrupt, @@ -501,6 +501,8 @@ static int pic32_uart_startup(struct uart_port *port) out_f: free_irq(sport->irq_fault, port); kfree(sport->irq_fault_name); +out_disable_clk: + clk_disable_unprepare(sport->clk); out_done: return ret; } --=20 2.35.1