From patchwork Mon Oct 24 11:31:08 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 9372 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp476485wru; Mon, 24 Oct 2022 07:14:04 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4q3KprTKETJOf3aTFX1W4NbVdxh1yIah9Qx2OP3jIgek1UDp/OS2bV2HNV6Su+WgWXyi8G X-Received: by 2002:aa7:cf0b:0:b0:461:2271:8559 with SMTP id a11-20020aa7cf0b000000b0046122718559mr19480871edy.92.1666620844404; Mon, 24 Oct 2022 07:14:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666620844; cv=none; d=google.com; s=arc-20160816; b=oOsSq4XjU8Rdf/4/g2rCjnR6QMLXmRhzzFM8igyiks5i0wfnteAetwDM0IY+8Mb5j1 XnVvhUAIYw5Ga7/NgJGc+rR+a2+BbodMM5jR41x6vwv4iojMuepPC4pMJ10vkUN8U6N4 SmcMJjxYt/b5BSEZqzn88tPM9Dp5j8K75EcX2J2mpXdfwB275amndoBpGn77DHww8bzP TrIB1OitI3cTiWK2Uh6pOuFo6whi1eOCq6mjTz6XsSxjpp78IIDGng8G94/xNK5w6eNW JMFfQSq65unnEv36l4msclX5la8Soz84akcYh7Gwio2BbwWErR5U6i3K8svIwjOt40Un JNgQ== 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=VN/ZhL/+2gwdWZCCCXosWejfzSNh7KUdlyhVqIkn4qE=; b=1DuF4r+6sKJCKTT8h0CRQ/yiQDKzkBVoLC0GI1oBO48P6hV2CrSOSdCVWoKe1pn21P 93o7qz6ngUYPdnkp8K9qpumoKfW6241pE9O/Whfwn3bmMKbDEp2FqOajpX/odWBCt1kj LgR4fC6FLPFPs8RPLStXm5KgpG7dC5qVCiHUEXISs3LySfG20xEwZjySQ7Cf7bDQ7E+u JJ0zwClUFLjXp6tH98bp+iHKIP/Q/eWKZEDh2hqOfjD+gCSENCtOisnB6mVgtv6/a3ts FV1Y24MgMw6LkRnWM8clsJiqA+nnC29yn8UhyMxKu1USBQfUGXGK3S8kB3/71MM90zKh TJrw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=wIC+v7qA; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r24-20020aa7cfd8000000b00460f87643e9si10628082edy.476.2022.10.24.07.13.39; Mon, 24 Oct 2022 07:14:04 -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=wIC+v7qA; 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 S233505AbiJXOCM (ORCPT + 99 others); Mon, 24 Oct 2022 10:02:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46814 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232087AbiJXOBE (ORCPT ); Mon, 24 Oct 2022 10:01:04 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3A5EC900DC; Mon, 24 Oct 2022 05:47:31 -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 4E4A4612DD; Mon, 24 Oct 2022 12:47:14 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 63B57C433C1; Mon, 24 Oct 2022 12:47:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666615633; bh=7DGMLTKFsU7+7Ad+NpWJf8+q3b2TJwi8QfsrxUDd5oo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wIC+v7qA7sS5nHDaSDUl6hDs7q90fdAE2HAkmer7BDusldQ51c6n+BRDa0RaAXOap KZKmyyYJl8gY3eoMbhZ0snKzjFJLSsQ8qvWpcQIU338aDXaYSpUxigmRrXPTBgjruX v5skNNWGWsXzoISnovbAv8VH0SDlD8C6tV8U/9uM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dan Carpenter , Sasha Levin Subject: [PATCH 5.15 324/530] drivers: serial: jsm: fix some leaks in probe Date: Mon, 24 Oct 2022 13:31:08 +0200 Message-Id: <20221024113059.687570720@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221024113044.976326639@linuxfoundation.org> References: <20221024113044.976326639@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 X-Spam-Status: No, score=-7.6 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 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747578618269290376?= X-GMAIL-MSGID: =?utf-8?q?1747578618269290376?= From: Dan Carpenter [ Upstream commit 1d5859ef229e381f4db38dce8ed58e4bf862006b ] This error path needs to unwind instead of just returning directly. Fixes: 03a8482c17dd ("drivers: serial: jsm: Enable support for Digi Classic adapters") Signed-off-by: Dan Carpenter Link: https://lore.kernel.org/r/YyxFh1+lOeZ9WfKO@kili Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- drivers/tty/serial/jsm/jsm_driver.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/tty/serial/jsm/jsm_driver.c b/drivers/tty/serial/jsm/jsm_driver.c index 0ea799bf8dbb..417a5b6bffc3 100644 --- a/drivers/tty/serial/jsm/jsm_driver.c +++ b/drivers/tty/serial/jsm/jsm_driver.c @@ -211,7 +211,8 @@ static int jsm_probe_one(struct pci_dev *pdev, const struct pci_device_id *ent) break; default: - return -ENXIO; + rc = -ENXIO; + goto out_kfree_brd; } rc = request_irq(brd->irq, brd->bd_ops->intr, IRQF_SHARED, "JSM", brd);