From patchwork Wed Oct 19 08:30:44 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 4937 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp226233wrs; Wed, 19 Oct 2022 02:45:20 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7GsDH1RClc5r56yBZPwvif9GAg3zwOFbz12s+DS9FSMeIemNuB+m0Au1dlI5E2Il9hlmXD X-Received: by 2002:a17:902:d2c3:b0:185:3bda:46f8 with SMTP id n3-20020a170902d2c300b001853bda46f8mr7437380plc.58.1666172720505; Wed, 19 Oct 2022 02:45:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666172720; cv=none; d=google.com; s=arc-20160816; b=JwQWkwej95Ml3x1aEo8TLplAA5FyC5r/v5od9OCy32AL+E2xwzviFW8UyJ5r18OsIN +kmV1Rp1eldD+lgf+/ErCK30r33EEu7NyoecZTSQ0p5TVC7rx4DmglSNNvgWVTCKkVGM El77awtT6hzUYWkwzqb25pRTJ/rU1BHxwc49A04B2z3dMF1JkG7HBXaj2rkzLvv/8ckC R40MsZHElWcpj7FU+DWcG32nYon1NrR2ew7Rm2ebNYTEw2GJsjNziYYAZaySe/8ABWED ZjD53gwvDv5Q4vFTF9KX0td45Wck0bxbpLJE2/QjIc5mOeiMVWWq1rFqop8ZmIklpVm5 60yQ== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o23-20020a639217000000b00434d4a0be40si18978862pgd.589.2022.10.19.02.45.04; Wed, 19 Oct 2022 02:45:20 -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 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747108726514951802?= X-GMAIL-MSGID: =?utf-8?q?1747108726514951802?= 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);