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 8B56EA046B for ; Tue, 23 Jul 2019 03:04:01 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 7FE1A1BEF8; Tue, 23 Jul 2019 03:04:01 +0200 (CEST) Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129]) by dpdk.org (Postfix) with ESMTP id 0E7001BFDE for ; Tue, 23 Jul 2019 03:03:59 +0200 (CEST) Received: from Internal Mail-Server by MTLPINE2 (envelope-from yskoh@mellanox.com) with ESMTPS (AES256-SHA encrypted); 23 Jul 2019 04:03:56 +0300 Received: from scfae-sc-2.mti.labs.mlnx (scfae-sc-2.mti.labs.mlnx [10.101.0.96]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id x6N11HgF026580; Tue, 23 Jul 2019 04:03:54 +0300 From: Yongseok Koh To: Andrius Sirvys Cc: Rami Rosen , John McNamara , dpdk stable Date: Mon, 22 Jul 2019 18:00:56 -0700 Message-Id: <20190723010115.6446-89-yskoh@mellanox.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190723010115.6446-1-yskoh@mellanox.com> References: <20190723010115.6446-1-yskoh@mellanox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'bitrate: fix unchecked return value' has been queued to LTS release 17.11.7 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" Hi, FYI, your patch has been queued to LTS release 17.11.7 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objection by 07/27/19. So please shout if anyone has objection. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Thanks. Yongseok --- >From f74b758583a7c302902b14b0646884e3617e5d13 Mon Sep 17 00:00:00 2001 From: Andrius Sirvys Date: Thu, 18 Apr 2019 09:52:06 +0100 Subject: [PATCH] bitrate: fix unchecked return value [ upstream commit 72ec13b0a1192d7a1503c12474cb0f11d2efe087 ] Checking the return value of rte_metrics_update_values, if failed returning that value. Coverity had picked up that that the return value wasn't being checked. Coverity issue: 336863 Fixes: 2ad7ba9a6567 ("bitrate: add bitrate statistics library") Signed-off-by: Andrius Sirvys Acked-by: Rami Rosen Acked-by: John McNamara --- lib/librte_bitratestats/rte_bitrate.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/librte_bitratestats/rte_bitrate.c b/lib/librte_bitratestats/rte_bitrate.c index d39edbf627..92e7c775c1 100644 --- a/lib/librte_bitratestats/rte_bitrate.c +++ b/lib/librte_bitratestats/rte_bitrate.c @@ -96,6 +96,7 @@ rte_stats_bitrate_calc(struct rte_stats_bitrates *bitrate_data, int64_t delta; const int64_t alpha_percent = 20; uint64_t values[6]; + int ret; if (bitrate_data == NULL) return -EINVAL; @@ -153,7 +154,10 @@ rte_stats_bitrate_calc(struct rte_stats_bitrates *bitrate_data, values[3] = port_data->mean_obits; values[4] = port_data->peak_ibits; values[5] = port_data->peak_obits; - rte_metrics_update_values(port_id, bitrate_data->id_stats_set, + ret = rte_metrics_update_values(port_id, bitrate_data->id_stats_set, values, ARRAY_SIZE(values)); + if (ret < 0) + return ret; + return 0; } -- 2.21.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2019-07-22 17:55:11.271543637 -0700 +++ 0089-bitrate-fix-unchecked-return-value.patch 2019-07-22 17:55:06.422474000 -0700 @@ -1,15 +1,16 @@ -From 72ec13b0a1192d7a1503c12474cb0f11d2efe087 Mon Sep 17 00:00:00 2001 +From f74b758583a7c302902b14b0646884e3617e5d13 Mon Sep 17 00:00:00 2001 From: Andrius Sirvys Date: Thu, 18 Apr 2019 09:52:06 +0100 Subject: [PATCH] bitrate: fix unchecked return value +[ upstream commit 72ec13b0a1192d7a1503c12474cb0f11d2efe087 ] + Checking the return value of rte_metrics_update_values, if failed returning that value. Coverity had picked up that that the return value wasn't being checked. Coverity issue: 336863 Fixes: 2ad7ba9a6567 ("bitrate: add bitrate statistics library") -Cc: stable@dpdk.org Signed-off-by: Andrius Sirvys Acked-by: Rami Rosen @@ -19,10 +20,10 @@ 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/librte_bitratestats/rte_bitrate.c b/lib/librte_bitratestats/rte_bitrate.c -index c4b28f6248..639e47547d 100644 +index d39edbf627..92e7c775c1 100644 --- a/lib/librte_bitratestats/rte_bitrate.c +++ b/lib/librte_bitratestats/rte_bitrate.c -@@ -67,6 +67,7 @@ rte_stats_bitrate_calc(struct rte_stats_bitrates *bitrate_data, +@@ -96,6 +96,7 @@ rte_stats_bitrate_calc(struct rte_stats_bitrates *bitrate_data, int64_t delta; const int64_t alpha_percent = 20; uint64_t values[6]; @@ -30,7 +31,7 @@ if (bitrate_data == NULL) return -EINVAL; -@@ -124,7 +125,10 @@ rte_stats_bitrate_calc(struct rte_stats_bitrates *bitrate_data, +@@ -153,7 +154,10 @@ rte_stats_bitrate_calc(struct rte_stats_bitrates *bitrate_data, values[3] = port_data->mean_obits; values[4] = port_data->peak_ibits; values[5] = port_data->peak_obits;