Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp6743301rwi; Mon, 24 Oct 2022 05:40:41 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6J0a9lqiSmZb7A2ltKGJ7gu5BV4TohhTcLkqlXBycgTm0OsFDhZWZsO0s7M7I0gUIaod63 X-Received: by 2002:a17:903:2286:b0:182:2f05:8abb with SMTP id b6-20020a170903228600b001822f058abbmr32087187plh.14.1666615240815; Mon, 24 Oct 2022 05:40:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666615240; cv=none; d=google.com; s=arc-20160816; b=jhyUyXysJymuvwUR3/trWG+QGX2++tGIENiWjJ62DHoiynS9WbFB/HHUcWAmMs6GsI WMuYZfO3H1ect/ZSNVaZ5bAvoFehBruVNrqvAZaRrkwpl3GkCKUAJSrQNxdScYa8Hly5 wYaL5HF42CDCESPy/haGYL4/bu6ZXppi2x+TSs6RglkAwmFQ/8gTb9ae8bCjYQLWu2Fo GMes23dqkyP9sUGBY+f87MPX1FAQS5bgodWjCrYNbre2M2JzZod0JwqFRkv31LYkit6b LVoR9/zu7n7vt43wl7EYNLyTr/Wir3unRmyEBkO3+XGSYv8KpEZ04RFhme8xU45mgn1Y wYsA== 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=S/l8vtVnTZEeeHK0MzYhcQOV+UCtJYCeqEKc+x8Pj4I=; b=0M4QntoYbTfYU+gIzyDYRBfSck+vrbGNm8wgNu0qv2MKFk8EibeZyNWjo8GNdxVw2e fSVO5MXtl47s/tOMO9NJKwjMKofNkSbxyyoVi5tjRimXa31SDcawKbqELdIwOstPDBvH hNyUUBEPaTVB8LCM9WFkIjhmTKyHgEfKAzUGQCRy0/y9l3ZIsgHvY4Oeokt7kmH5XMZz h9yezxJADghYYV7CNX/fRA73I5tkhE/a1CIpB2IqqnAaNmQHienxbRPYWJF3U0E2BObM +4vjHrXeLAj1bymuxQ5uW1EKyqP1BHEnnF1NdtN8doyRQCUKY9isDs6O4Vlt9C1HC1yK oQzg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="t/bOnbj9"; 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 x70-20020a638649000000b0045a048683dcsi31867787pgd.236.2022.10.24.05.40.28; Mon, 24 Oct 2022 05:40:40 -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="t/bOnbj9"; 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 S231928AbiJXLwP (ORCPT + 99 others); Mon, 24 Oct 2022 07:52:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44620 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231883AbiJXLus (ORCPT ); Mon, 24 Oct 2022 07:50:48 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6A9192623; Mon, 24 Oct 2022 04:44:27 -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 ams.source.kernel.org (Postfix) with ESMTPS id 833DEB81154; Mon, 24 Oct 2022 11:43:02 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DBB7FC433D6; Mon, 24 Oct 2022 11:43:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666611781; bh=+GjL2Rjrt+fxHkBg7wAqfLsMT5uaAxlKW2kUnp4VXCA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=t/bOnbj9g9HE/GHzPMsMyeU04pFeCBTqREYbbAuQkusHLKoTd5JH4PMeLaSn66ajp EbRSXwljjK9AkB5qIBIy9NjNKTOEKwBKtxHdwj4iJwACBjRJNkV7wMg4Hi4b+kADDd YgiStnDKBShY/eurGCAtowuZfbkRoqZRrDT5hJOk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dan Carpenter , Sasha Levin Subject: [PATCH 4.9 108/159] drivers: serial: jsm: fix some leaks in probe Date: Mon, 24 Oct 2022 13:31:02 +0200 Message-Id: <20221024112953.395636233@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221024112949.358278806@linuxfoundation.org> References: <20221024112949.358278806@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 a119f11bf2f4..3971abb0963c 100644 --- a/drivers/tty/serial/jsm/jsm_driver.c +++ b/drivers/tty/serial/jsm/jsm_driver.c @@ -221,7 +221,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