Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp2121081ioo; Mon, 23 May 2022 10:30:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzBYaLLtDrG/bFPyTFn5Qd9dX0aXwzcCYXztHvUanV5tBPtDqFZBDNqLbkW+Rlr82bkRSar X-Received: by 2002:a17:902:f605:b0:14d:9e11:c864 with SMTP id n5-20020a170902f60500b0014d9e11c864mr23814295plg.54.1653327045031; Mon, 23 May 2022 10:30:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653327045; cv=none; d=google.com; s=arc-20160816; b=RS/uu4/jnfWsdoe1+JPSC3DAMa+Z4AkZ6IKCsU8pDrWBMpwZFzETdD0jMJHHuMQlYX baEOu3ggVPRsmEb2E1tpFaW5OuO3+L75Gzzg7WsFpE7V63ZQ2vLzZFAl0+ADtdmUDBxm CfpbYF23Dr3jd82Llrz+21SKd2Nb0KueLK3BYEwaN5XCbTp/TEoDjYnwoSqiSyha4Mhy oqC3ETecIWVkWYDRDKq2cQuzk2j3qCG4dH5hsMMoaV0FrNabmnHefS8oTTpLHkP4gn+O uItGbLGs9tlXilLk3PVUTdb4urE4kaXZvrkewY1OL1iLAVfRYAFlIDH1L+PLVlb5t2fV sFGw== 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=Jc9bB00fEcP0Q6etUx2Su7MITabomYRXyny/GpHG14BOIw6MwBmPe4bvbfDvQAEHDs ozXFbEkwWbPO+6w6A8cI4KIz4wA3IuTL+JWV7/iTJz2daDbrNq4EGaoVd6Qt7XITEus3 E2Z8i7DfnId5Qscr+2S2kHl7NM5KlxwvXCYGCbo+rI/3UmVzrS6ezx+3FPZfjDjbpStF CLkxC8HkPBgi7lcEjAz756wJ4h00cQWq7tXbkXILQUo6zAOnpUSkCQgnQlIL1mQf8FzI mDRPgPG7u1a6o2/yKLrjuXV45N4yPiczBwV4IUUtmp6wfXeWkaQw3+DqPkebth5kmFBz RNTw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=2Ml9HN0x; 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 e5-20020a170902784500b0015d04e10579si9179052pln.352.2022.05.23.10.30.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 May 2022 10:30:45 -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=2Ml9HN0x; 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 E8EC491565; Mon, 23 May 2022 10:30:24 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240806AbiEWR0G (ORCPT + 99 others); Mon, 23 May 2022 13:26:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37912 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240579AbiEWRQa (ORCPT ); Mon, 23 May 2022 13:16:30 -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 1E14B719D5; Mon, 23 May 2022 10:15:55 -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 70421B81219; Mon, 23 May 2022 17:15:12 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D8BE2C385AA; Mon, 23 May 2022 17:15:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1653326111; bh=T4OxzCgaUBm2DqSHVnJ48Imayt8DaPfRZpxmkuNlJUk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=2Ml9HN0xf59Xlob9KLBLjTkPVP6QXGphZ44KZ4SYU6exww4+Qr4gWP/3G7NbJwDZP gkM0PTd7lnoCLGx/j92SJCdi2NbToKwIuiD3AB/qTQwpRMQ8q0KYpHxtU2gf+iAXlI ufVt8qM1tSNpujuJx9UdiuyRTzytk7/Y1Q9s7WBw= 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 5.4 56/68] ethernet: tulip: fix missing pci_disable_device() on error in tulip_init_one() Date: Mon, 23 May 2022 19:05:23 +0200 Message-Id: <20220523165811.740514836@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220523165802.500642349@linuxfoundation.org> References: <20220523165802.500642349@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