From patchwork Mon Oct 24 11:30:54 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 9998 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp616003wru; Mon, 24 Oct 2022 12:27:48 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7fxV74evAyx/sDCcJMkBel/PWOz253eUEf5m6AFvu9tea76Qa8sxMMb6lm+Pk7F4XXY0Is X-Received: by 2002:a17:907:608f:b0:78e:1b60:60e2 with SMTP id ht15-20020a170907608f00b0078e1b6060e2mr29474266ejc.382.1666639668099; Mon, 24 Oct 2022 12:27:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666639668; cv=none; d=google.com; s=arc-20160816; b=H6BzzqYdjLWGz86bomkQx9ncDt7WixMPxPescYTd0UUxVjpmYBkYibi2XiLn/hJBnZ FFNVQ0ifOo4/1Mt5OBoMpwyidaBaSpu1CbXlC/cmj9HHMPeYZIvv/doNUIinEGa0ve83 k6rxsM8Ny5QoDrEXJyHZIw84nBBR4LNSmArK7Szi+HTMQ9wKIj3Fz2uWohOhFrAeZ4L8 FxjoT0YgPMtacVHHvFWlwHLaq1t+BekNvtdk5mk0LiFX3b/u8HR0Ncb4Ivq2amLXeqAf cSnWpUSHZvf1C1Y8sLIWmrLxKo/tOJ1ZJQaBRdkdN8X7vU7mj4f22bHns2SXzPMICLUH gdow== 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 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.27.24; Mon, 24 Oct 2022 12:27:48 -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 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?1747598356606884453?= X-GMAIL-MSGID: =?utf-8?q?1747598356606884453?= 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);