All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kaiwen Deng <kaiwenx.deng@intel.com>
To: dev@dpdk.org
Cc: stable@dpdk.org, Kaiwen Deng <kaiwenx.deng@intel.com>,
	Jingjing Wu <jingjing.wu@intel.com>,
	Beilei Xing <beilei.xing@intel.com>, Ting Xu <ting.xu@intel.com>
Subject: [PATCH] net/iavf: fix core dump when the link is unstable
Date: Tue,  6 Aug 2024 08:35:27 +0800	[thread overview]
Message-ID: <20240806003527.2901320-1-kaiwenx.deng@intel.com> (raw)

Physical link instability may cause a core dump.
Unstable physical links can result in a large number of link
change events.Link change events captured by vf before vf
resources are allocated will result in a core dump.

This commit will check if vf_res is invalid before calling it.

Fixes: 5e03e316c753 ("net/iavf: handle virtchnl event message without interrupt")
Cc: stable@dpdk.org

Signed-off-by: Kaiwen Deng <kaiwenx.deng@intel.com>
---
 drivers/net/iavf/iavf_vchnl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/iavf/iavf_vchnl.c b/drivers/net/iavf/iavf_vchnl.c
index 6d5969f084..b85debd40d 100644
--- a/drivers/net/iavf/iavf_vchnl.c
+++ b/drivers/net/iavf/iavf_vchnl.c
@@ -255,7 +255,7 @@ iavf_read_msg_from_pf(struct iavf_adapter *adapter, uint16_t buf_len,
 		case VIRTCHNL_EVENT_LINK_CHANGE:
 			vf->link_up =
 				vpe->event_data.link_event.link_status;
-			if (vf->vf_res->vf_cap_flags &
+			if (vf->vf_res != NULL && vf->vf_res->vf_cap_flags &
 				VIRTCHNL_VF_CAP_ADV_LINK_SPEED) {
 				vf->link_speed =
 				    vpe->event_data.link_event_adv.link_speed;
-- 
2.34.1


             reply	other threads:[~2024-08-06  1:38 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-06  0:35 Kaiwen Deng [this message]
2024-08-22 17:06 ` [PATCH] net/iavf: fix core dump when the link is unstable Bruce Richardson
2024-08-22 17:16   ` Bruce Richardson

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=20240806003527.2901320-1-kaiwenx.deng@intel.com \
    --to=kaiwenx.deng@intel.com \
    --cc=beilei.xing@intel.com \
    --cc=dev@dpdk.org \
    --cc=jingjing.wu@intel.com \
    --cc=stable@dpdk.org \
    --cc=ting.xu@intel.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.