Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3088526rwb; Mon, 15 Aug 2022 17:50:55 -0700 (PDT) X-Google-Smtp-Source: AA6agR4b7JCR0FGn4nCYNnQsDC9bIH96ZtLjGwOlkvwla+4cd2vOAf10ObRFCuo1gl4rnETI9t4j X-Received: by 2002:a05:6402:350a:b0:43e:9d8:b75 with SMTP id b10-20020a056402350a00b0043e09d80b75mr17170159edd.23.1660611055020; Mon, 15 Aug 2022 17:50:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660611055; cv=none; d=google.com; s=arc-20160816; b=qOOBzq0sdNjmTUtF03nhBNc/RHZBVwg2AU3TIJ0VOiwn0cLiAD6B4QXhD8eCATvDSN U/90TpRjH3Vrp42YHHK6ZnyEYNm/NUXIDffxz3UWJFcSoHM5/rAbf5rYBpeIBPLJXPoW x6u69Tn7gzenfhU1ZAU8sq3axBDSzLwJrEzcSwkRK+4e3Jox03T6+FePSWRkgIUpFUET IZsnGiFXKg7dqQR25YF3pIGXK6AntVMoH3h5qyllD8aw3h/1h4HX0Rrk6wqOMMSKctkD Af19gGJpZMP50s5uf1klYN82UaeegbZtNU10XF7tA3cNm2YcQQ9lXWaGxYFNqlzPFB4l mz+A== 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=FmBsmXZxh9Y6RNRX4kY7qu3aCZCxeYWFBpEBKcCP4eU=; b=ctQKCVSYM/9nq5P9GEFsP3Onr9dOGdVIub98LiapfoFrWj/f1AQg1c+n4GATT8GmYk RI501fsSQX5H3PFjDQrhqyBCoP7HqAsjx2WxsXxXQjXqPFXs/wBOVy0mTVZCO5UFXnD6 QZ0raxj+0sraaX6Sb8cpOE1tTfgGUU3Gr3LiGjQP4hZ+KpKvBSlaWv6lkpMQwUK5Ixgw yJGu9X5GkmrqQueuA3NONTl1baGBoqwA3kCM9sbyS5W6JF3vwm3RhqaJaRxX5ymoSuz+ qp5zfvMZlqtp2NWQmtTFe/x9akj9JbjYY4Ty67KvrvtgP6oCt3Fjlz5sll/MoWytgQVW U80w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=xcndvjRe; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z15-20020a1709063a0f00b007316e39ba62si8285634eje.235.2022.08.15.17.50.29; Mon, 15 Aug 2022 17:50:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=xcndvjRe; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S1350581AbiHOWb7 (ORCPT + 99 others); Mon, 15 Aug 2022 18:31:59 -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-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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@huawei.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_uart.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 = -ENOMEM; - goto out_done; + goto out_disable_clk; } irq_set_status_flags(sport->irq_fault, IRQ_NOAUTOEN); ret = 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; } -- 2.35.1