Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp2116285ioo; Mon, 23 May 2022 10:24:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwcuOnKCEXCJWUOsSe/t8j8uwkjykS0AzO95tNLvZVNvANWtvEF1ii/o773gFACu+ZewD8H X-Received: by 2002:a05:6a00:1ac9:b0:518:a48a:d8f6 with SMTP id f9-20020a056a001ac900b00518a48ad8f6mr5459131pfv.16.1653326654134; Mon, 23 May 2022 10:24:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653326654; cv=none; d=google.com; s=arc-20160816; b=JWCQO1G4k6E2U/MHwPhyT+0neORJ1AXhmmQWoWJI7qE57KiMXUaH5tiFZgfgGsOsWd EY1PKXz7vmBs9UDg/fp9I7ShxbZ+SKtqM1NcE7PNUXEypM+Kf8Ksj2GsHPWt4v0cTCfM jisd/a58uK4yW/LqdTAQNnOvv2eAquHxtWBu7QhDP07ZrIsZ6WqU46Cvt7JeGYkLVcX8 /0BzbjhnJ8NIkq4FC4I5b3ra+sioME2MXgwkcvrj+kqTbAXdlsdCUUT4HgoHmEyKYw2T lx2ksF1MYTTVpaY8WjTyHJXLgno4htmd2mY2iBIAADCfxVwB0tAxgTUWEkm+3qvi4FUP HlFQ== 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=tOzNQsjDmngUymDLOd555v7gYtq9tslAtRbFu4MtC9s=; b=CDEn3S25/48q/emSZRs/lBDhFp+78x2npn9iFJpA8erLKuBv9Nx5SDu785eCmpGxm+ jzf8qBhLlxBz1z9m08LKe+NJ7HBI1v6lVPABMc3AgY+PwF8MC7JrG6Ve65zYCJQu5XK0 5ivHqiiv2rjKqVbwS5Cx4+7nrMJF03SDd8J5at8lWP9Kzw+arIjkMx/KavAjzaHm46vC /GI13o5zbdnrC43FRYxgJ1E7L1VV7/j8qgDCgPfS4QLTi3oChiIx/972oD6k/3ALIfNm wtdKozaHMWP/tut26oYz7RdNx4uHQ5K5GVxeL9GypWyGgB5FtXCcO+XBuvWbrFmGu8pS fwVg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="Ljcv/ahW"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id nn15-20020a17090b38cf00b001cb73339defsi16473108pjb.183.2022.05.23.10.24.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 May 2022 10:24:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="Ljcv/ahW"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 0D49681497; Mon, 23 May 2022 10:23:52 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240352AbiEWRTI (ORCPT + 99 others); Mon, 23 May 2022 13:19:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37698 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240298AbiEWRQN (ORCPT ); Mon, 23 May 2022 13:16:13 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0128B6D4E4; Mon, 23 May 2022 10:12:56 -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 90B86614DA; Mon, 23 May 2022 17:12:56 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 92A32C385AA; Mon, 23 May 2022 17:12:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1653325976; bh=T4OxzCgaUBm2DqSHVnJ48Imayt8DaPfRZpxmkuNlJUk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ljcv/ahWVI7Q43sT8mcPSXqO/snc7g2uQpSeFCS1zEOsJbheH0IXwuoqQ992Daslm SodIr969UqMFqkC0CYhBYI36YmMaN77UK/H3ZRY6FGb2M1DdN7GnuAy/ZhsQ3msKbM OztOm5OS/eBtJrTYGLlJPbrzgx1bhgQ1wKREC9R8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Hulk Robot , Yang Yingliang , Jakub Kicinski , Sasha Levin Subject: [PATCH 4.19 39/44] ethernet: tulip: fix missing pci_disable_device() on error in tulip_init_one() Date: Mon, 23 May 2022 19:05:23 +0200 Message-Id: <20220523165800.496326853@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220523165752.797318097@linuxfoundation.org> References: <20220523165752.797318097@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE 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 From: Yang Yingliang [ Upstream commit 51ca86b4c9c7c75f5630fa0dbe5f8f0bd98e3c3e ] Fix the missing pci_disable_device() before return from tulip_init_one() in the error handling case. Reported-by: Hulk Robot Signed-off-by: Yang Yingliang Link: https://lore.kernel.org/r/20220506094250.3630615-1-yangyingliang@huawei.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- drivers/net/ethernet/dec/tulip/tulip_core.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/dec/tulip/tulip_core.c b/drivers/net/ethernet/dec/tulip/tulip_core.c index 3e3e08698876..fea4223ad6f1 100644 --- a/drivers/net/ethernet/dec/tulip/tulip_core.c +++ b/drivers/net/ethernet/dec/tulip/tulip_core.c @@ -1410,8 +1410,10 @@ static int tulip_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) /* alloc_etherdev ensures aligned and zeroed private structures */ dev = alloc_etherdev (sizeof (*tp)); - if (!dev) + if (!dev) { + pci_disable_device(pdev); return -ENOMEM; + } SET_NETDEV_DEV(dev, &pdev->dev); if (pci_resource_len (pdev, 0) < tulip_tbl[chip_idx].io_size) { @@ -1788,6 +1790,7 @@ static int tulip_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) err_out_free_netdev: free_netdev (dev); + pci_disable_device(pdev); return -ENODEV; } -- 2.35.1