From patchwork Mon Oct 24 11:30:59 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 8941 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp435178wru; Mon, 24 Oct 2022 05:53:45 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7g4nQBBP7xLU6fA1jgfmDItRhDkh4QHNx63VqaWV2Ba1ebj5Y3X8OcWkOBWBgpFgzHfHwZ X-Received: by 2002:a17:907:7f1c:b0:78d:ddc7:dfb1 with SMTP id qf28-20020a1709077f1c00b0078dddc7dfb1mr28277069ejc.189.1666616025475; Mon, 24 Oct 2022 05:53:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666616025; cv=none; d=google.com; s=arc-20160816; b=BZYlNVIoy8vBvKw+ABcnhJg/Ew2Gibzgyt31SLLo0WG8/YfJQbLskGAs06aqa9NCab 6H4Fbv5DKPkkjxCvECySNRe0DzNnLTmwSynmsV+6FrWWsuDNh3vu8aVYa7faZyJ9qOsh 05Ep/zsIkGqqbqf8HwB8AiwEDioqIL/yowS2Z0SBf6Yt7AeFvKBv9yUiRSY+w8Jbs1iG 1SdNOIOPUi144QnDtNgUTaIZhQeqWRifHqtuxAGnKxZA2PL1ivgxrK/h3j2l1lFvDEAS 6aLWw/gZcjFyqFELWKIHYCd/emQrpwiXUlu5pv5ijcMSBGNMWnkhEZWHvMStfJZV5sSS mleA== 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=x7gSp2HSRdjoYghO2cgua/liE+dvyKeoWzhmuAomQwk=; b=EVra0KTdWx+r1Y42i2YopUzFnPrq76RphGJ0dBpXRXUej3PQZfbdMMor2n9MGpeLMh w7WayEwz6FAU96WvtLegtGrx4jLqOL+vxcAnONFafZP21Ovjkg631sFULPYXklG1P4OR /Rv7X1jCOmV72z94jMGZp9LU2rZDLNiBml6h3VYv4UMLn+j+Yy0GmcMTpj5p9Iu145wn tzqKvKp9vYT6DNeh3T/PK4whvAeXNHY12Jcn6iH+3qDM8lEpBfO7suXOdhl7Tgu4/HSS RLj4aoD7iHn3pmQdaVln55iq/k/NGbyG2DXbWgKbO7Fj36WhbFGXXjjRWzXRauCaE+62 4OiA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=LBBuclyt; 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 i19-20020a05640242d300b0045bd55b122fsi34170864edc.57.2022.10.24.05.53.20; Mon, 24 Oct 2022 05:53:45 -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=LBBuclyt; 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 S234658AbiJXMwb (ORCPT + 99 others); Mon, 24 Oct 2022 08:52:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56434 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232287AbiJXMrs (ORCPT ); Mon, 24 Oct 2022 08:47:48 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 908469184B; Mon, 24 Oct 2022 05:12:39 -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 3904D61252; Mon, 24 Oct 2022 12:11:12 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4D07AC433C1; Mon, 24 Oct 2022 12:11:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666613471; bh=NwiRgoGNNgwSk51Vc6rEQuhFQM5Y9IwYt/EDlaVrrCg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LBBuclyt0fxruzcZQH7fW6R0THoP7BGCDRiPn4KccOlbTW12Y0jflcyXUDdRxdOgh xwV04EsaJVCvQVpAmar7TjIJ0blws+TKedyKTnKHSwSrQeL7HYZuBoSrErNpXMEFJw iQ0Jw8kGU8ZIriyiYiiYMHtkS/5wYMdxRo5G9dUQ= 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.4 149/255] drivers: serial: jsm: fix some leaks in probe Date: Mon, 24 Oct 2022 13:30:59 +0200 Message-Id: <20221024113007.570051825@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221024113002.471093005@linuxfoundation.org> References: <20221024113002.471093005@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?1747573565423794328?= X-GMAIL-MSGID: =?utf-8?q?1747573565423794328?= 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 592e51d8944e..07e9be9865c7 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);