From patchwork Mon Oct 24 11:31:02 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 8485 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp403608wru; Mon, 24 Oct 2022 04:52:46 -0700 (PDT) X-Google-Smtp-Source: AMsMyM40n5h1sLUb7IyIYxQT157PfZOFult3LKU6SF9WSp/EFaROzPWMcz4PlQHcZQJjSPCiaZkP X-Received: by 2002:a17:90b:224d:b0:20d:8828:3051 with SMTP id hk13-20020a17090b224d00b0020d88283051mr37208808pjb.89.1666612366674; Mon, 24 Oct 2022 04:52:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666612366; cv=none; d=google.com; s=arc-20160816; b=xsfWvylL/+qsgIU5fyYpa0BVVoqgxGvCsAbi9tnzZhoZrhjU0LJh9x4k4gAtPbLg2I 2agOLaFQXtJ7ybvqwSmdN/p9QHn6d1eM+7K56GI13hmY9KTBNNa1z+ckPBnXBkVLr54i a9+EhtN5P+iMhMvUR/eKcc41vVQ+pc9N1HRkqppd9Y/sryCXxc0lSWOl6AF7ASSauZ+3 FxVmmr+SnQlQi62vm22QuTLMwzj2jeSex9TcKRZ1bgi4YERQCOIFYWZFNZXFFRsjUPFO y++3UBv3ofFbR0sO8HGvVETEu01SM75Q8UsGiign+ND3Y0iI+sBMEAC3ziq/AzVUz02P FNmw== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y15-20020a1709027c8f00b00174eef66680si32351966pll.120.2022.10.24.04.52.33; Mon, 24 Oct 2022 04:52:46 -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 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?1747569728870230585?= X-GMAIL-MSGID: =?utf-8?q?1747569728870230585?= 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);