Received: by 2002:ac2:464d:0:0:0:0:0 with SMTP id s13csp3688748lfo; Mon, 23 May 2022 11:30:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwQbbJbA+386WWXdkjujxOWWj7Rpl2DgYdIv5m6vOe/9kXBvKap2jrgluKHaOTaZ+iYa2Jq X-Received: by 2002:a63:1a1d:0:b0:3f5:eb02:b6b4 with SMTP id a29-20020a631a1d000000b003f5eb02b6b4mr21494088pga.343.1653330612761; Mon, 23 May 2022 11:30:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653330612; cv=none; d=google.com; s=arc-20160816; b=KCJjJj+tL7j14bqC9nfOtDEPoeFkq+a4gXuamxhseLhQYJxr5ujxrcft3O3SILyk/A FrlduaIVtwgyNkdjl+VMwWciGAgTcNIJb7OPi8Nhlwd/B2MciyVigeMWdUsV7C25Stn0 zqRtK8uaU/5EbH5z1QY3oLVCb1vrbGZci4jxNjNM+SiGjiBxy4Etuti6YIRdx4WSrl4j b+H1oVEN3phmZv9CPZv8CIqTmSxyPjN/mTy/tnvVzZ3LDmDhJFaPFxiter8AN50GZ9yO AofQsWQsYQg70SZyU1T3b9NRcJe7+SNvhQyHVWx0mCj0bbxvfETnhwkTjz4mcmpn67bC YjJA== 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=UdSh4TgTsOwsdacUAnsVUMQn4p+vImPkSr6xoHeJtF0=; b=hRXxD3wFBm9EZrsJ3UvWNzVGkQh7a3bVU6+SfoJrbVrVuk9BmCnmP1ymYqwQTHyrAm NwC1wqGqL1hCBPH5m0kzOO3XPz9o4lvEKWZZvPQWvXRoJ77wmSnjtRKiP1yyxhYWhdth De/hKc5skvG6AdBS3hVmZ9xP+M/seJbHRQe7C5DQzok+x4UQL0wdYnlpePe9y3UdWagn SkbvYvYmWyHaGIxh0UJer0VJW+/K9NbOe45mfy3C/zzb5crL+4t3UBAZt+Bd4uhWu23o PMiJnAftBca8mEQhWSkDyQG6jMS5r7g9r4Sauvronl+3wZ7bP2T9Gcwr4s+G37qaVaZf DKKg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=IrTxBmEu; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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. [23.128.96.19]) by mx.google.com with ESMTPS id g16-20020a056a000b9000b00518418d73ddsi16374579pfj.333.2022.05.23.11.30.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 May 2022 11:30:12 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=IrTxBmEu; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 19E1713C350; Mon, 23 May 2022 11:29:56 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243717AbiEWSGB (ORCPT + 99 others); Mon, 23 May 2022 14:06:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42412 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243053AbiEWRhw (ORCPT ); Mon, 23 May 2022 13:37:52 -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 8EEE067D05; Mon, 23 May 2022 10:32:02 -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 39595608C0; Mon, 23 May 2022 17:31:13 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3C71FC385A9; Mon, 23 May 2022 17:31:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1653327072; bh=3ttDH7Ouwvsv4SWQiq9osTp1Ju2Kv4XBmQr9tWoCqqQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IrTxBmEu5Gk8YCYkxRNdvbElzf8SB89qcNo+mE/ox1vOlCu7xEJP5/jLFuM/MzHxi NUmO8z3rwNfZwN7mFkkipHAWh/5Em3EWdRzF2xNzajNc3bQuvoLHU7ac4dp6vrO8bp ULEkOHZZYGZSHtRmyjm99Wtn5okkpQowExyiKKWg= 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.17 148/158] ethernet: tulip: fix missing pci_disable_device() on error in tulip_init_one() Date: Mon, 23 May 2022 19:05:05 +0200 Message-Id: <20220523165854.672364357@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220523165830.581652127@linuxfoundation.org> References: <20220523165830.581652127@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 79df5a72877b..0040dcaab945 100644 --- a/drivers/net/ethernet/dec/tulip/tulip_core.c +++ b/drivers/net/ethernet/dec/tulip/tulip_core.c @@ -1399,8 +1399,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) { @@ -1785,6 +1787,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