Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp825878rwi; Wed, 19 Oct 2022 03:32:29 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4M8iG5yIgJxNpKoWU96dCEN2RWHAUE+Ia6YDyv9BBoAXNnKSygY0mJUkCkbl+BFDXhfZM6 X-Received: by 2002:a05:6402:5190:b0:45c:fca7:e07b with SMTP id q16-20020a056402519000b0045cfca7e07bmr6797929edd.327.1666175548349; Wed, 19 Oct 2022 03:32:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666175548; cv=none; d=google.com; s=arc-20160816; b=STB7Vmb4g6njozZp3XDTzlLaRRAxFoMqvUgdFeKPFEwwnLLZBETKHo7wACmu3Wj+yy zVqO9ke9CjWLsDzKsjin9rYcmp7iGB+bpQLRNtalYAYg0ZUtdbCJ2cWINYyLzaCmlBFW jLmMqqsD4+Vy0EMFQNZydajxoM07FY47k6c/tHNnETqTmxDlm6deF/OchYXbpHsP071n 3npcT3b3JMuc+WiJqM3aJw0xcEJInSFRLnfC4g9jDfbt+MBp8b1KhFFg9N/jyA9eqfe4 nICpRsuCVhzmt1/Z8KToZ5LIfJ2CKeUaB0+RVKpZRIl5yieAC0Cv1Z59pKqiMfyzw/HZ m8OQ== 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=vUr68C2SCx+XfD702zR1gkWa8bowS46VJQo4C+gvGux5iFab4S7WX1SHSPtSE+l2nb GBYIznS42MrCfh/WUeTB2vndd0L8VkhyaT6g0KpbMrc+yaCcYeq9B1bMmkwisCYituWe e4/6x56+5LIobEjjYAwmQWGKi5WrAKu4YEhcRSS1ifw7j+rHUQ/CfFX5lmpRF9M1HcPI DJ11/lpl24K35Req78B8s7lHhvzRL0RCEe67g+YYxTxxYQer4qTh3zGcZX0ntbm8dTw7 mLvzTWs+gBagy2LEBHSMoCxNRg/Zf+CjS96aNtxUP9mZXLKTfkXi5HSJokVz8AqMJG+X Mh8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ckOTFgtc; 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 eb10-20020a0564020d0a00b004537a3c4982si15974882edb.601.2022.10.19.03.32.02; Wed, 19 Oct 2022 03:32:28 -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=ckOTFgtc; 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 S233617AbiJSJd0 (ORCPT + 99 others); Wed, 19 Oct 2022 05:33:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47902 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233706AbiJSJ3J (ORCPT ); Wed, 19 Oct 2022 05:29:09 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B03FEE9840; Wed, 19 Oct 2022 02:12:58 -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 98B5E6170D; Wed, 19 Oct 2022 09:03:03 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id AE16BC433D6; Wed, 19 Oct 2022 09:03:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666170183; bh=7DGMLTKFsU7+7Ad+NpWJf8+q3b2TJwi8QfsrxUDd5oo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ckOTFgtcUZD80Rai45v3NCemAHznQ9lL6rqElUH8/scEYfm/CyVN3nyrI5P70hYTH cVIBTC2Mh7Lze7YpvjBnce2IfUUz0hh3cd5Ss/kAo/Lmx7/Ok232KQkE9Ugz/2i2Oc GnEFqn2T/EXf69o69y4PkdTAqNv2gvgQ1PI+tYLw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dan Carpenter , Sasha Levin Subject: [PATCH 6.0 557/862] drivers: serial: jsm: fix some leaks in probe Date: Wed, 19 Oct 2022 10:30:44 +0200 Message-Id: <20221019083314.583713096@linuxfoundation.org> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221019083249.951566199@linuxfoundation.org> References: <20221019083249.951566199@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.4 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 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); -- 2.35.1