From patchwork Sat Oct 22 07:25:26 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 7480 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4242:0:0:0:0:0 with SMTP id s2csp1101464wrr; Sat, 22 Oct 2022 01:21:01 -0700 (PDT) X-Google-Smtp-Source: AMsMyM48A7PiWZ3KwYuQiwpRUNZ5qHrMiZsaZH38gY+VePe0qLXZN+iDUi6Fi2hhuIesmyMCTDpF X-Received: by 2002:a05:6a00:2305:b0:565:60b0:40d9 with SMTP id h5-20020a056a00230500b0056560b040d9mr23062831pfh.77.1666426861642; Sat, 22 Oct 2022 01:21:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666426861; cv=none; d=google.com; s=arc-20160816; b=VT6dsArp6tbsiwpiqrvD6MOhC/zy8Yy6sQwgSD+gq9dOXc5WzNcFmaGY0GlnZfIXR2 Cp509y4bbo60HvI+pqrFD7+zhKlyBezhYqQKTKLjDCrB5CYteSm52CCohUNqdaKoq6Tc I2wSHd9ngKjl2rrdZGD4wBHDmY6U7vfWKiMp8PejYYIpVLsIxlWZ39nuJ8JiH0zQtN+W Te9f3unXj6tVcRyIbYjIGaIT+5ezfIZDQvUVT32RUOYvIDCGxCnriMorkiyIyyU27xxy e3EzCY1Vd3XQuqHx/KhzFf5M8NeBvsPHUMdKTOe+U5RUgkp0r3TgfuOoIS8YdwCPzLp9 whuQ== 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=fxKkghAihWU1te0aVlFQeHDkQyzCUEKtxWRSqLjYxMdp2oBMOgARuM8KQdyOp+dsVn 2BVYNEd9mKO9rhArmPtaZNLQHzPhFT30SWbH6ItJne1eOLdDsi4IJ0w1yrs4Ht2AgyXC EjakzruTCiaQ6YHw4T6oqWcX55WQM2DK9nrUJakpTM7cnsbqNpZnoCea236FalhBGpug TTrmC2jUjy10nvb4LJqKkJTCeMswFzwFWB9hf10aSIDSnHwTUGkS29Nrs0TrO/TUC6vE toyOSbUqVCuTZvMR74N3QY8QavTVAk4k6XYszGyDER2i3TZLYSi9TSaDK7FWYAstEaMZ TI0Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=bKC2mKzE; 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 oj10-20020a17090b4d8a00b0020d887ded6esi9881924pjb.120.2022.10.22.01.20.48; Sat, 22 Oct 2022 01:21:01 -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=bKC2mKzE; 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 S233370AbiJVINQ (ORCPT + 99 others); Sat, 22 Oct 2022 04:13:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54406 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233308AbiJVILP (ORCPT ); Sat, 22 Oct 2022 04:11:15 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 35A7F42E50; Sat, 22 Oct 2022 00:54:46 -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 DC5E560B09; Sat, 22 Oct 2022 07:54:34 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D22F8C433D6; Sat, 22 Oct 2022 07:54:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666425274; bh=7DGMLTKFsU7+7Ad+NpWJf8+q3b2TJwi8QfsrxUDd5oo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bKC2mKzEk3DyJUY38R1Ax7izzoAQu2T7tNkp7gAx0vaDzdwoRX7RCsbhwfJBa/s/A Wr+7+yAXykKxgEi19m6Zi8SXMle5C+pNcUQIDC/KpPAea2APtTJkdUFIS16fCSP4HQ QzwvgDd9hJvY1EPMZ747pCIaB0WGo/ub+sEeXSPk= 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.19 447/717] drivers: serial: jsm: fix some leaks in probe Date: Sat, 22 Oct 2022 09:25:26 +0200 Message-Id: <20221022072518.048667262@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221022072415.034382448@linuxfoundation.org> References: <20221022072415.034382448@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 X-Spam-Status: No, score=-7.3 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?1747375213266892707?= X-GMAIL-MSGID: =?utf-8?q?1747375213266892707?= 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);