From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 46C39A04A2 for ; Wed, 13 May 2020 11:17:57 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 8BABC1D171; Wed, 13 May 2020 11:17:55 +0200 (CEST) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 975631D171; Wed, 13 May 2020 11:17:54 +0200 (CEST) IronPort-SDR: B4cvlSdtHGQAyvdH5gwQP5xY0fmCmgH7U3+fgZwg8142KjuZTO9+OK6CI/8XHJJ1/rqU1nljk5 VD5YVHWDRyZA== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 May 2020 02:17:53 -0700 IronPort-SDR: T/zO0ebtbZ2/uQ+e8/RLwn94kO6KDjiyjw3hjokek0QA4mCaepW2fy2MmORwHqu8OYC8jsfg/o H+s8GeglodsA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,387,1583222400"; d="scan'208";a="463868860" Received: from dpdk-xuting-main.sh.intel.com ([10.67.116.253]) by fmsmga005.fm.intel.com with ESMTP; 13 May 2020 02:17:52 -0700 From: Ting Xu To: dev@dpdk.org Cc: thomas@monjalon.net, ferruh.yigit@intel.com, arybchenko@solarflare.com, stable@dpdk.org Date: Wed, 13 May 2020 17:16:27 +0000 Message-Id: <20200513171627.80657-1-ting.xu@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200511102504.23936-1-ting.xu@intel.com> References: <20200511102504.23936-1-ting.xu@intel.com> Subject: [dpdk-stable] [PATCH v5] ethdev: fix DCB set failure X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" When rte_eth_dev_rss_hash_conf_get() is called, if the variable rss_conf is not initialized, the pointer member variable rss_key may have a random address, which leads to an error in the following processing. This patch initialized the variable rss_conf to avoid this situation. Fixes: 16321de09396 ("ethdev: allow to get RSS hash functions and key") Cc: stable@dpdk.org Signed-off-by: Ting Xu --- v4->v5: modify commit log V3->v4: fix build failure v2->v3: move memset to rte_eth_dev_rss_hash_conf_get from testpmd v1->v2: modify commit log, move memset to else leg --- lib/librte_ethdev/rte_ethdev.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c index 8e10a6fc3..b20c6bb2d 100644 --- a/lib/librte_ethdev/rte_ethdev.c +++ b/lib/librte_ethdev/rte_ethdev.c @@ -3552,6 +3552,7 @@ rte_eth_dev_rss_hash_conf_get(uint16_t port_id, RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); dev = &rte_eth_devices[port_id]; RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->rss_hash_conf_get, -ENOTSUP); + memset(rss_conf, 0, sizeof(*rss_conf)); return eth_err(port_id, (*dev->dev_ops->rss_hash_conf_get)(dev, rss_conf)); } -- 2.17.1