Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp7292761rwi; Mon, 24 Oct 2022 12:28:38 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6f73/E1G2KX/44ULXA3w/VkxKY1ysLMMgWehunHFn1t7MYpjXrtrJR6qSNnU+2m1HfsHC8 X-Received: by 2002:a17:906:dc8f:b0:7a5:8160:1995 with SMTP id cs15-20020a170906dc8f00b007a581601995mr8121876ejc.500.1666639718059; Mon, 24 Oct 2022 12:28:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666639718; cv=none; d=google.com; s=arc-20160816; b=SuJnTevuTBMTtKQ+NLqfDeyOwH9z1+6BXTNc4PiJCYkZPUPG2JIuoLq3ekjnK/bxxm hNNuyJm1MJ/tcAtJ1UB58ec30eFkjFVf0unFaQIrXgMgbao/js7+qO2QUBuOWFxnblY4 8YFwJPuIe98tyYYHGuqhA2YjY5c4puNyAdXQsI1BtIvo30q7L+X/tUk/f+Lnd5jirodG MWk04fvW9gzi5lGGoB7f30SOArZ4WsJe7ldcPgabjYATZ4IGtfrOO1lmAlbZcSAMT1ST wo46iVTa3/bQQDQsaw8czmeLRNMWmj4pr9X58/LHmtGRIYGmWgm5RtGysU/WFG0vpXWv QMqA== 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=+Fi8FhAU0orUc6ufel01lVEdyKb/FbFd4Pkx9FjxR/k=; b=nhRWYN9tUc0X/a/cF9d/L+A0bnsigmN+vyyvkoOea8wle6CHzigyF2x82lNTPVysBw SManEmH/EOwBqzCBNwyi+eSYa+Qjo021fDPQ95aa76OKNesudqPRx7Ngra0eEnZYHBV1 Co5IExzCFlHa8IMAT8/uc4iDKqUObdVjenJ9svI3KnhLD8SHSwah8QTrYOjZe38Z72xV sRO1uZvs22LMiXPw1abRLH0Hm6cZdpAU14Bmkuo03WJzgZiDlvxzUXI8+BxuJxTkeV6t HSFgsWusHw+uTFWEsJLgLcldSQEnqSg9kVMj4VefrEIsMjTkhoM/xjlM7um1Y2lC2KMo EunQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=hKb00Z9C; 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 l10-20020a056402254a00b0046150eb704csi582962edb.532.2022.10.24.12.28.12; Mon, 24 Oct 2022 12:28:38 -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=hKb00Z9C; 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 S232676AbiJXTZ5 (ORCPT + 99 others); Mon, 24 Oct 2022 15:25:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44566 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233375AbiJXTYO (ORCPT ); Mon, 24 Oct 2022 15:24:14 -0400 Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0EB2650068; Mon, 24 Oct 2022 10:58:23 -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 7E4DECE1354; Mon, 24 Oct 2022 11:52:39 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 95766C433C1; Mon, 24 Oct 2022 11:52:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666612357; bh=O58E1AyVjyogFsMTYnODPtbKaiCqX9nWLSX/gDKhIGE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hKb00Z9Cp3JHDX0of6vQVnIO/WEUXub57KaW4nqhDQAEJ55O3+GNIO4LFbkBuySvt 0ZEsgj1CBmha6p8KHz/4rPsAsvf9YR0zCPmhdOElUr1zq8UcxBg+tlhryhX0BjLaIn 4AZOX5j1tVnE97xF5+dTzTh09dJreb6hTwDm3wdY= 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.14 137/210] drivers: serial: jsm: fix some leaks in probe Date: Mon, 24 Oct 2022 13:30:54 +0200 Message-Id: <20221024113001.439764275@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221024112956.797777597@linuxfoundation.org> References: <20221024112956.797777597@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 102d499814ac..bd4efbbb7073 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