From patchwork Tue Jul 13 12:20:27 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dongliang Mu X-Patchwork-Id: 477337 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 701EEC07E95 for ; Tue, 13 Jul 2021 12:20:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 51769611CB for ; Tue, 13 Jul 2021 12:20:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236221AbhGMMXe (ORCPT ); Tue, 13 Jul 2021 08:23:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43014 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236085AbhGMMXd (ORCPT ); Tue, 13 Jul 2021 08:23:33 -0400 Received: from mail-pf1-x435.google.com (mail-pf1-x435.google.com [IPv6:2607:f8b0:4864:20::435]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 21210C0613DD; Tue, 13 Jul 2021 05:20:43 -0700 (PDT) Received: by mail-pf1-x435.google.com with SMTP id p36so9699181pfw.11; Tue, 13 Jul 2021 05:20:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=N12Qt0FbX8/A1qRMnGp6XJs1s3QP6zmQUn6Y4fY3u94=; b=hfylIuaTT2n81A+A5vS0z3hJLKe3dvZTZw1MoT9Kpifs+cFkL+LOJ9zq0o130wRkqe nnp+KeDfqvAkInKZO3PvoCSx5716riVxvltU0TobGnesfnbMUAFW1AExyChi37nacWKK OywwrydZum1BJGoqpIU5hjWDX6+XFc9b2T2t+5qkuPJtlaXoeXcjAKFgKie8bZgh9nrI I8Q4gIIn5jIS6T4NcUR3+MOqgVaH3zA2j18/gTyjVqaagGUymW4TV7U4uV7ZCXYxHbe1 BrvS8Sce5SrcltkHn4cuuqSxCL9nncOx7u9/iD9b783lq50K4aDs0ZE6sPge+FHGuLxn SkBA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=N12Qt0FbX8/A1qRMnGp6XJs1s3QP6zmQUn6Y4fY3u94=; b=l4Pw72NF55FxfhElqKtW9h6c1ukdUfe5kdJ1IS+PI6Hwzl9fosSwhntA4r2YGzcPio xy2UOPODQv5cQxhRnEn7a2BZJNmGHWCk81dsNZiiIwjHEfRIS4O5+h4//kFlvnBQrhwk RAH1vDN9zSogGpVogPG43QqSo4rRVsvrHKnhLdLrWcoPVdQ2bhmYTMTX+PiqwUDI9QiP 1Wk6Rnws7ylkAd2je4y2Kgstc5d7hLd7XMCZZVX2S/qkbNo7mk7vwl9xRfmvVEP1mNyP 6oOIidaMbobP77zzEoHZpM5jPqoBa+oOjrG+7rZSDX6IPf6Sft5KLyiGmAGGjdfSq8MQ a98A== X-Gm-Message-State: AOAM532n0e7ohkcLcQfdV8o2gqPpAGEycJyifQm5I89UYMlcHAk+Ueai QPeDpool9Zin/iss2BUip7k= X-Google-Smtp-Source: ABdhPJxPMiF0vYDmisrDv8/T6niOAkHikVbq4qnURKb/AumrClNXbcI7A+KC4w3ocfGZkTX2IrtuXA== X-Received: by 2002:aa7:90c8:0:b029:32c:935f:de5f with SMTP id k8-20020aa790c80000b029032c935fde5fmr4380311pfk.79.1626178842534; Tue, 13 Jul 2021 05:20:42 -0700 (PDT) Received: from localhost.localdomain ([154.16.166.218]) by smtp.gmail.com with ESMTPSA id d14sm20248253pfv.171.2021.07.13.05.20.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Jul 2021 05:20:41 -0700 (PDT) From: Dongliang Mu To: Jesse Brandeburg , Tony Nguyen , "David S. Miller" , Jakub Kicinski , Dinghao Liu , Jeff Kirsher , Shannon Nelson , Catherine Sullivan Cc: Dongliang Mu , intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] i40e: Fix error handling code of label err_set_queues Date: Tue, 13 Jul 2021 20:20:27 +0800 Message-Id: <20210713122028.463450-1-mudongliangabcd@gmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org If i40e_up_complete fails in i40e_vsi_open, it goes to err_up_complete. The label err_set_queues has an issue: if the else branch is executed, there is no need to execute i40e_vsi_request_irq. Fix this by adding a condition of i40e_vsi_free_irq. Reported-by: Dongliang Mu (mudongliangabcd@gmail.com) Fixes: 9c04cfcd4aad ("i40e: Fix error handling in i40e_vsi_open") Fixes: c22e3c6c7912 ("i40e: prep vsi_open logic for non-netdev cases") Signed-off-by: Dongliang Mu --- drivers/net/ethernet/intel/i40e/i40e_main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c index 861e59a350bd..ae54468c7001 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_main.c +++ b/drivers/net/ethernet/intel/i40e/i40e_main.c @@ -8720,7 +8720,8 @@ int i40e_vsi_open(struct i40e_vsi *vsi) err_up_complete: i40e_down(vsi); err_set_queues: - i40e_vsi_free_irq(vsi); + if ((vsi->netdev) || (vsi->type == I40E_VSI_FDIR)) + i40e_vsi_free_irq(vsi); err_setup_rx: i40e_vsi_free_rx_resources(vsi); err_setup_tx: