Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3119212rwb; Mon, 15 Aug 2022 18:35:21 -0700 (PDT) X-Google-Smtp-Source: AA6agR6Yko8oun/tO9HZ4qxzyD2Rzhn5Z9eLQYefYiSUSE64lvhIK/liw/iq5emlq7S4Am0uRqNj X-Received: by 2002:a63:c012:0:b0:41c:1148:ec9 with SMTP id h18-20020a63c012000000b0041c11480ec9mr15720028pgg.444.1660613721332; Mon, 15 Aug 2022 18:35:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660613721; cv=none; d=google.com; s=arc-20160816; b=RZ47KuSjdZ8JPLOr5d8LZPbp6756eXU836g+b8C3Wp4xHSoq+AVDZrqPyFCCOSA7oH QZDq7BvppFs+JpHw/NSoUFgQnGtMyBjOSB5hWz0/iPWC66YWgEUpndsG14wwEsfThuwg Fa5uPdgvh9usuNEER91VLKKRv7HCSd4+i+NsVQ18MfNHpa1NFxkWZI3xYap/oqy9z0FY /mApr8IZm6MuN2aA/CEGVdQYj/MdyADXQL2K8/bCnLscM6IydrxCpsn3lmSQreZsCdMR kZznTRBV+PyiaoDJZJkhoyvqdlu/1BNcr1367PEjAC1PVhymQRRG5OM/wDD0dWaW4CJ5 rJ+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=wjb5nA4cpTgaNbUSW7GAOMXjoWmYw5XqfZCiCEB3IYo=; b=ZqxD1pBzzQwF48jYfPtAHsfOpNUOFN2JtIsDLmR2Oampkc452sJXTZ1J2PgDKpW4CZ hg7uWq+DieBeUt8SpTij+Ex6JLL/JkNkTr9luQlytaf3l534kQXWWu1dBTDYyLPGfsNx oNL3x5I19x54vXgXvuFtPMGHs8aXVKwGGVwPJQ1E+ILU6LXU2VLbAxC3c600R3Nt+p5L RHcJpPleAVP7YNRk4VDKkDegmg5/rp6fxU+ftpKGyrkt7OYkwPZUfwW8tO8QHSKdEZJr 522cGWhpqrQ+zLzX+cjKuxYH1b0Krldqw6g2XF3fz9B4Uzwd59VFTXS9Jsnf/UMz1wjY 84GA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=pOWttz6c; 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 137-20020a62198f000000b005251a325ea0si7463568pfz.269.2022.08.15.18.35.09; Mon, 15 Aug 2022 18:35:21 -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=pOWttz6c; 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 S245372AbiHPAii (ORCPT + 99 others); Mon, 15 Aug 2022 20:38:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42164 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351696AbiHPAga (ORCPT ); Mon, 15 Aug 2022 20:36:30 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D4E9B18AF6B; Mon, 15 Aug 2022 13:38:05 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 6B17760F60; Mon, 15 Aug 2022 20:38:05 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5D314C433D6; Mon, 15 Aug 2022 20:38:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660595884; bh=ZurvHXy/PIhBJFstbkZGNdrhZW8zwizCA+LB6kC0hGQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pOWttz6c8s4tSgw5rcSLGgGNDKH3rIamcUU/V31C+33BrWkM7FfMXLOByVStf+caD 3J3Ru+lQYabj9c8PtZfvcGzmPqjm4bEP/fDWafs3PfoKP53jljwH70hEY/JprE0NUK xsYtwSVnnj2AQlM+30bkB9dah2gsEWptr2yzsLGg= 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.19 0898/1157] serial: pic32: fix missing clk_disable_unprepare() on error in pic32_uart_startup() Date: Mon, 15 Aug 2022 20:04:14 +0200 Message-Id: <20220815180515.360402684@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180439.416659447@linuxfoundation.org> References: <20220815180439.416659447@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 b399aac530fe..f418f1de66b3 100644 --- a/drivers/tty/serial/pic32_uart.c +++ b/drivers/tty/serial/pic32_uart.c @@ -503,7 +503,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, @@ -579,6 +579,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