Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp7386363rwi; Mon, 24 Oct 2022 13:58:32 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4ucO8NysN+bBfpZ3HzjjuCoHhgbQkAYpPX+h0ssk1TlYA59pwNXVgG33HiaFfKunxXZBk/ X-Received: by 2002:a17:902:d2c5:b0:186:afd7:56d3 with SMTP id n5-20020a170902d2c500b00186afd756d3mr5125525plc.142.1666645112530; Mon, 24 Oct 2022 13:58:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666645112; cv=none; d=google.com; s=arc-20160816; b=n5+x+tvRDUP4UhWX3nsz2IYRA4F6OYurqqRvh8kFpDgHBcn9KaklJ0Ge70RXAHWaJn 8oHKUKbwbd4X5kOqGDrz25aK0EXHxR97APrH6C06nFsXm58TvUX24eY8KVukCn9swtj2 UWyTFlqtL/rdga+FZtoCXegR8ewYIG2ZD+t/hBbct1f8a2ttWY+rqLSrXjOjdLQm3Vcp 45oGJaCsKYZ+G6X2Y+k48QfDNHnxELx38XU+HvOzGlTh42aU9doTvWFRLSw7yjDiqxtQ ce1LC8cjDO80KnCNVqNi0ufgAMjpLbYfATThGA0H9+26sR+5Yu7XYjGJj4K+NGeZBx3L FddA== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id pc11-20020a17090b3b8b00b002024f3f1f8bsi1194452pjb.70.2022.10.24.13.58.20; Mon, 24 Oct 2022 13:58:32 -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 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 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); -- 2.35.1