From patchwork Mon Oct 24 11:30:32 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 10197 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp642006wru; Mon, 24 Oct 2022 13:37:07 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7SQvADOWHp00uH6vBeL0YVcf0lqW1PQAkMJXLVWDtwBwU5XmRaeIV/vhiTqf2qTBvLHUgh X-Received: by 2002:a63:689:0:b0:46e:be81:566c with SMTP id 131-20020a630689000000b0046ebe81566cmr15729003pgg.403.1666643827359; Mon, 24 Oct 2022 13:37:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666643827; cv=none; d=google.com; s=arc-20160816; b=k7RVIGV+aEHZLQ2O74vCLmzAPwAIoKnON0niSSi2ywxcoWUUzCKNOP4LTGlWt0/n3G c3vCPCEfe/d+QzDFkc6vGVjK7ChrFhCn9PqFPvapaEnfkw++B8WYMHU8HyN7/KpF05BN WWOcktraz7V77xqoTUT6bdm5n028DP3jJnj0HGIAFvd4lOc//9Nx9N4NmbSvnZWrA/Pw QzTYKgcvP2L6fbnWTxkYLUcONk3XAcyAqHiTfa85kFKbXO60RV4EGUBBGVF+VYEI6AlO 94j7NXdMfBzCdTTm0DEeElJJ/k6DGa29fE1wChQZ3ENouefcebAoE3OsIntG/yMM/Sox TFGw== 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=JRx4ih6ORBF6np8Jgqif91Kj6bPnjkgtWgOtv00/wjU=; b=VWGuQHwq5ikpPh6yHHb0eAD2peOWIfDEaHAP6BCZ453Xft273lGsHYppLjVNpQ9QJZ eTmSg2l66k361jaXsjXJl7sh1azKB8n4ZN6Qj0tpLHNnyccfIqS9ob8EcygpmyfexZaM H4xzrTUopv7RwAUrFjGefgMFUzCLKLSHrmU+hLYscw9PFmpsZe+WTJMkeabVhnQ8rYE8 jrJTpAHf9TzQscIKwTsSb+rSYn2rQM7MyAKghGbmbWAKQA42NWaUTUli5DxzCk9mQvTJ 1k7rAxn/h4dT53HJm2fSRfBBKxLlx/xNGAJT7cSR8RNrhQEUznnt69vtoRgqlcNtCPVR jBkg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="V2/Qa++l"; 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 d11-20020a170902cecb00b00186658dbbcesi600610plg.339.2022.10.24.13.36.53; Mon, 24 Oct 2022 13:37:07 -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="V2/Qa++l"; 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 S232830AbiJXU37 (ORCPT + 99 others); Mon, 24 Oct 2022 16:29:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48078 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234538AbiJXU3T (ORCPT ); Mon, 24 Oct 2022 16:29:19 -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 517AC2A79CA; Mon, 24 Oct 2022 11:42:00 -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 47B03CE13CE; Mon, 24 Oct 2022 12:26:10 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5918BC433D7; Mon, 24 Oct 2022 12:26:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666614368; bh=WIvTqs1acMoSVbKnDuXeGSuPERelrKyoyWSq23nnmSY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=V2/Qa++lOc0sgEaW022WbeHO9eKvAKuQ4zoCM5bTuIj1Jr0y1HdBE3VNN6L3MLFK/ EN201RR6E75gRfiLzAkPeClZJ0AiJHQ7NUEAMsidK+056GAfBHkcTDGYn2d8aW/FeA U0WSbW4OYaz3ctM5jsT8pMpOoo/Hj0HuAFiQuoJE= 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.10 235/390] drivers: serial: jsm: fix some leaks in probe Date: Mon, 24 Oct 2022 13:30:32 +0200 Message-Id: <20221024113032.791120600@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221024113022.510008560@linuxfoundation.org> References: <20221024113022.510008560@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?1747602718179146764?= X-GMAIL-MSGID: =?utf-8?q?1747602718179146764?= 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 cd30da0ef083..b5b61e598b53 100644 --- a/drivers/tty/serial/jsm/jsm_driver.c +++ b/drivers/tty/serial/jsm/jsm_driver.c @@ -212,7 +212,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);