Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp2162175ioo; Mon, 23 May 2022 11:33:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwFic9HHn2lfRMa0NeiKpn5uMImauSh7kKOq5BihvowTDZEt9WrycGDR6pIkzRUMFtxQwoI X-Received: by 2002:a63:cf13:0:b0:3f2:82c4:f279 with SMTP id j19-20020a63cf13000000b003f282c4f279mr20980417pgg.348.1653330835001; Mon, 23 May 2022 11:33:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653330834; cv=none; d=google.com; s=arc-20160816; b=Pu6S/tnYovX6hIvvPPSpAdUpSDCB+i92XH6Wano5N5HR/raPcfPt6K0UnW5MC5nISz 35ND8uxDJXLLRfZGnPpoljlE+3DpfD4WGEVsbhDQKSp0vdRH/2eFPfpeSFwNIJIhmDMs EhWKT+Gv9y4qC44+kscE/W15/p0TfaxPGnQhpKVdvJ9HTHR8IjPU0XgSFvj+uXMHPQkz 5Q0C7rFwUMLm9cg6fiB41C9lbuNkIWc/SZs2OxQpatBgG7xVIP3FZJ+DGqQR/SUUqara XXOdhCdqhfqLyFnKIkPHYa2xYqG9PVuEPa6uj+YF+ogV1mFKac/Dx6KDbaB7qcPLo1zV 2g6Q== 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=aetM6XBebla6fNQ5KlnW/yF00ZPIC0MPmgPa/IX1VFI=; b=g3jdVEkV/g2m+duI8LlbSVmQ0DKF9NtdBKcAmKNNgGoqSEZFoJgpyeTbuL6kWyrKyg //blCgRYG9vVmMimgMGsbw3ms9rYKP8HBKrMQxQfyH6K91a36pvhVcSslOpRVCkLqUfq RPBeVRsUZ5dlFx02KHKU1PtsxgxLViJsORIIY1g0LMHu3Vyj+lCNhCcRIj85MRdAXzNU vI0l31CTTctwKBpTD84UxRObjIreSh5uSw1xEm9rtWWBSfHtAWTRvcu5BAi4ZiTKjM7T WDSx2jNLpyG/4unQxSwtThWImBE8W9hGhMljbzWKsdv7gYW3b/14WzrTs52YZqcAFrZw QH+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=NnbWJO5d; 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 q10-20020a170902eb8a00b00154a68405d3si10902603plg.134.2022.05.23.11.33.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 May 2022 11:33:54 -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=NnbWJO5d; 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 496AE15EA4F; Mon, 23 May 2022 11:32:18 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239780AbiEWRKt (ORCPT + 99 others); Mon, 23 May 2022 13:10:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34824 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239743AbiEWRJ2 (ORCPT ); Mon, 23 May 2022 13:09:28 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 55BE86CF65; Mon, 23 May 2022 10:09:12 -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 A5A63614CE; Mon, 23 May 2022 17:09:04 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8CFFEC385A9; Mon, 23 May 2022 17:09:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1653325744; bh=J6r/QpIudsRd9kmTBML/fcglHaqE7Am2Dj6WFc1ZLw0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NnbWJO5dO6X92oa1g6Ed13Ta3fwUl4GDZ3LihxxUWQT6rGVaPQNJ4e9ppN0SJ9XOY aqtYSMVhfRCooQwwfH8gdob5zXNtBCe9ZZbbj05wEtJe+qisDs6V0t7hnJpcFRz85l Mdpfdb9p1HSudwyPzgpsB+QIzj+ecfP2J1dsDvXE= 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.14 29/33] ethernet: tulip: fix missing pci_disable_device() on error in tulip_init_one() Date: Mon, 23 May 2022 19:05:18 +0200 Message-Id: <20220523165753.108638198@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220523165746.957506211@linuxfoundation.org> References: <20220523165746.957506211@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 851b6d1f5a42..35bcb2c52dbc 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) { @@ -1789,6 +1791,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