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: 8841 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp431587wru; Mon, 24 Oct 2022 05:44:15 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6yWeX4FHhokTOSxutsZUsxHah/OhXTHquBbhxp9uLzKQhQPba9FlsWqRgnd6z41A/9GR2Y X-Received: by 2002:a63:1b58:0:b0:45f:e7ba:a223 with SMTP id b24-20020a631b58000000b0045fe7baa223mr27035349pgm.548.1666615454854; Mon, 24 Oct 2022 05:44:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666615454; cv=none; d=google.com; s=arc-20160816; b=UU1aJo8p93FnDb2gZC2TPgRzzHQP00+rIJpCZQ81iGFx1foiLy5qnWKzZOq0ETLa1x evP4tq/NFYiFtDYH8PlVMn0tepLSJR0sQ+IwGD1LGFtRlnPSNg4CG2lMsU+uI0TarPpY sF06/QlF13JmUdsNhb0IuJYxJKOw//4GS3bsSLRE3I6wGLLzx0JQF9+L4Uczoeqk8uDi SugBb6kKrZUNYCXbYGKiDWbjKIF5/7nfdyOk2eQW9zR2H8umQ84BLszb0EiMbPxNjS34 Ed/bqIttjFSjouWsyQEm3qu5hONG6DcZPua73qPJ8qachv2ZfKQMEhMNl1yV494lMjTi 3Ldw== 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=N0d7VE4pe4XoQccs/zZMrAI5uTuWlaiLg5i1R4ugxvUBiZYtdtdUHCA9MH8mYzoFVg NnKQNJIVPdgnSntyhhVZhk9jduNlVItabgIRqWn4XWyIBg0WlD6YyqFBKsfUJxlJQFG2 3qwQpc7wEh3YSHtOvAlwtYcCZBKJmxeRBJMEkEdYZLWFalf07M5Jl+2Ivh5lccA2Bg8e r3aAAfA0trBK07SKvpCE3ANcX1Sj2OatmgScF8+yzLNlD4ERrie2cexoki5CuSUw8du9 mUgoiOt48xHy1gmEz+c4f90oEYrKnYSJpEfZjZ/jxXY90orScnmhUpwFOCsithLtX3Tj sNrQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=GpdtwrXu; 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 v7-20020a634647000000b00455db4531c5si35157389pgk.486.2022.10.24.05.43.58; Mon, 24 Oct 2022 05:44:14 -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=GpdtwrXu; 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 S234642AbiJXMfi (ORCPT + 99 others); Mon, 24 Oct 2022 08:35:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53744 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234259AbiJXM3w (ORCPT ); Mon, 24 Oct 2022 08:29:52 -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 37710895CB; Mon, 24 Oct 2022 05:03: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 ams.source.kernel.org (Postfix) with ESMTPS id CCDF7B81188; Mon, 24 Oct 2022 12:00:52 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2B2D6C433C1; Mon, 24 Oct 2022 12:00:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666612851; bh=NwiRgoGNNgwSk51Vc6rEQuhFQM5Y9IwYt/EDlaVrrCg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GpdtwrXu7CUE3Z2O7TYMhuW+TqY3a+XO/I+cpnNQ4DGWt1lxwIoH13B1CrbsnVBMO wXp0KCyib701ioeG6btZZzuY+h6GPq1olat5Jk2QsBQJqHir39m2DRvy+bdCMSGFtI RaZQYtGJr3blDxMG10DvttGYwIyIPj6aJ0Hhk3ns= 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.19 143/229] drivers: serial: jsm: fix some leaks in probe Date: Mon, 24 Oct 2022 13:31:02 +0200 Message-Id: <20221024113003.637923278@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221024112959.085534368@linuxfoundation.org> References: <20221024112959.085534368@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=unavailable 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?1747572967537148566?= X-GMAIL-MSGID: =?utf-8?q?1747572967537148566?= 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);