From mboxrd@z Thu Jan 1 00:00:00 1970 From: Shreyansh Jain Subject: Re: [PATCH 4/8] net/dpaa: fix the oob access Date: Mon, 9 Apr 2018 12:53:26 +0530 Message-ID: <8e340f7c-b20d-0947-5ef0-a6482a09094b@nxp.com> References: <1522918464-4586-1-git-send-email-hemant.agrawal@nxp.com> <1522918464-4586-4-git-send-email-hemant.agrawal@nxp.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Cc: dev@dpdk.org To: Hemant Agrawal , ferruh.yigit@intel.com Return-path: Received: from EUR03-VE1-obe.outbound.protection.outlook.com (mail-eopbgr50077.outbound.protection.outlook.com [40.107.5.77]) by dpdk.org (Postfix) with ESMTP id A00CE1B725 for ; Mon, 9 Apr 2018 09:08:21 +0200 (CEST) In-Reply-To: <1522918464-4586-4-git-send-email-hemant.agrawal@nxp.com> Content-Language: en-US List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Thursday 05 April 2018 02:24 PM, Hemant Agrawal wrote: > Fixes: b21ed3e2a16d ("net/dpaa: support extended statistics") > Coverity issue: 268318 > Cc: stable@dpdk.org > > Signed-off-by: Hemant Agrawal > --- > drivers/net/dpaa/dpaa_ethdev.c | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > > diff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c > index 0aad111..cbdc4f2 100644 > --- a/drivers/net/dpaa/dpaa_ethdev.c > +++ b/drivers/net/dpaa/dpaa_ethdev.c > @@ -339,6 +339,9 @@ dpaa_xstats_get_names(__rte_unused struct rte_eth_dev *dev, Definition of this function is: static int dpaa_xstats_get_names(__rte_unused struct rte_eth_dev *dev, struct rte_eth_xstat_name *xstats_names, __rte_unused unsigned int limit) > { > unsigned int i, stat_cnt = RTE_DIM(dpaa_xstats_strings); > > + if (limit < stat_cnt) > + return stat_cnt; As this patch is using the 'limit' argument, '__rte_unused' should be removed from the function arguments. > + > if (xstats_names != NULL) > for (i = 0; i < stat_cnt; i++) > snprintf(xstats_names[i].name, > @@ -366,7 +369,7 @@ dpaa_xstats_get_by_id(struct rte_eth_dev *dev, const uint64_t *ids, > return 0; > > fman_if_stats_get_all(dpaa_intf->fif, values_copy, > - sizeof(struct dpaa_if_stats)); > + sizeof(struct dpaa_if_stats) / 8); > > for (i = 0; i < stat_cnt; i++) > values[i] = > Once the above is correct, please use: Acked-By: Shreyansh Jain