patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Ajit Khaparde <ajit.khaparde@broadcom.com>
To: dev@dpdk.org
Cc: ferruh.yigit@intel.com, stable@dpdk.org,
	Andy Gospodarek <gospo@broadcom.com>
Subject: [dpdk-stable] [PATCH v2 4/6] net/bnxt: fix a potential segfault in xstats get
Date: Wed, 13 Nov 2019 07:06:58 -0800	[thread overview]
Message-ID: <20191113150700.2517-5-ajit.khaparde@broadcom.com> (raw)
In-Reply-To: <20191113150700.2517-1-ajit.khaparde@broadcom.com>

We would hit a segfault in bnxt_dev_xstats_get_op() if xstats
argument is NULL, Check if the argument is NULL and return appropriately.

Fixes: bfb9c2260be2 ("net/bnxt: support xstats get/reset")
Cc: stable@dpdk.org

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Andy Gospodarek <gospo@broadcom.com>
---
 drivers/net/bnxt/bnxt_stats.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/net/bnxt/bnxt_stats.c b/drivers/net/bnxt/bnxt_stats.c
index 40b496ac0..14d355fd0 100644
--- a/drivers/net/bnxt/bnxt_stats.c
+++ b/drivers/net/bnxt/bnxt_stats.c
@@ -468,6 +468,9 @@ int bnxt_dev_xstats_get_op(struct rte_eth_dev *eth_dev,
 	if (rc)
 		return rc;
 
+	if (xstats == NULL)
+		return 0;
+
 	memset(xstats, 0, sizeof(*xstats));
 
 	bnxt_hwrm_port_qstats(bp);
-- 
2.21.0 (Apple Git-122.2)


           reply	other threads:[~2019-11-13 15:07 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <20191113150700.2517-1-ajit.khaparde@broadcom.com>]

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=20191113150700.2517-5-ajit.khaparde@broadcom.com \
    --to=ajit.khaparde@broadcom.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=gospo@broadcom.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).