patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Wenzhuo Lu <wenzhuo.lu@intel.com>
To: wenzhuo.lu@intel.com
Cc: Bernard Iremonger <bernard.iremonger@intel.com>, stable@dpdk.org
Subject: [dpdk-stable] [PATCH v7 26/27] net/i40e: fix segmentation fault in close
Date: Tue,  3 Jan 2017 14:52:11 +0800	[thread overview]
Message-ID: <1483426332-117256-27-git-send-email-wenzhuo.lu@intel.com> (raw)
In-Reply-To: <1483426332-117256-1-git-send-email-wenzhuo.lu@intel.com>

From: Bernard Iremonger <bernard.iremonger@intel.com>

The vsi's have already been released, so the second call to
i40e_vsi_release results in a segmentation fault.
The second call to i40e_vsi_release has been removed.

Fixes: 3cb446b4aeb2 ("i40e: free vmdq vsi when closing")

CC: stable@dpdk.org

Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
 drivers/net/i40e/i40e_ethdev.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index be45cfa..0b7c366 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -1882,7 +1882,6 @@ static inline void i40e_GLQF_reg_init(struct i40e_hw *hw)
 	i40e_vsi_release(pf->main_vsi);
 
 	for (i = 0; i < pf->nb_cfg_vmdq_vsi; i++) {
-		i40e_vsi_release(pf->vmdq[i].vsi);
 		pf->vmdq[i].vsi = NULL;
 	}
 
@@ -4137,6 +4136,9 @@ enum i40e_status_code
 	if (!vsi)
 		return I40E_SUCCESS;
 
+	if (!vsi->adapter)
+		return I40E_ERR_BAD_PTR;
+
 	user_param = vsi->user_param;
 
 	pf = I40E_VSI_TO_PF(vsi);
-- 
1.9.3

  parent reply	other threads:[~2017-01-03  6:52 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1483426332-117256-1-git-send-email-wenzhuo.lu@intel.com>
2017-01-03  6:51 ` [dpdk-stable] [PATCH v7 09/27] net/i40e: fix VF reset flow Wenzhuo Lu
2017-01-03  6:51 ` [dpdk-stable] [PATCH v7 12/27] net/i40e: fix VF MAC address assignment Wenzhuo Lu
2017-01-03  6:52 ` Wenzhuo Lu [this message]
     [not found] <1480637533-37425-1-git-send-email-wenzhuo.lu@intel.com>
     [not found] ` <1483426488-117332-1-git-send-email-wenzhuo.lu@intel.com>
2017-01-03  6:54   ` [dpdk-stable] [PATCH v7 26/27] net/i40e: fix segmentation fault in close Wenzhuo Lu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1483426332-117256-27-git-send-email-wenzhuo.lu@intel.com \
    --to=wenzhuo.lu@intel.com \
    --cc=bernard.iremonger@intel.com \
    --cc=stable@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).