patches for DPDK stable branches
 help / color / mirror / Atom feed
* [dpdk-stable] [PATCH v2 4/6] net/bnxt: fix a potential segfault in xstats get
       [not found] ` <20191113150700.2517-1-ajit.khaparde@broadcom.com>
@ 2019-11-13 15:06   ` Ajit Khaparde
  0 siblings, 0 replies; only message in thread
From: Ajit Khaparde @ 2019-11-13 15:06 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit, stable, Andy Gospodarek

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)


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2019-11-13 15:07 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20191113082945.21277-1-somnath.kotur@broadcom.com>
     [not found] ` <20191113150700.2517-1-ajit.khaparde@broadcom.com>
2019-11-13 15:06   ` [dpdk-stable] [PATCH v2 4/6] net/bnxt: fix a potential segfault in xstats get Ajit Khaparde

patches for DPDK stable branches

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/stable/0 stable/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 stable stable/ https://inbox.dpdk.org/stable \
		stable@dpdk.org
	public-inbox-index stable

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.stable


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git