diff mbox

[1/2] performance: pktio: test return value of odp_pktio_close()

Message ID 1430153282-8312-1-git-send-email-stuart.haslam@linaro.org
State Accepted
Commit ddf21d74880fe31916ef00e6eff2a01edda4a71b
Headers show

Commit Message

Stuart Haslam April 27, 2015, 4:48 p.m. UTC
Coverity complains that the return value of odp_pktio_close() isn't
being checked.

This fixes https://bugs.linaro.org/show_bug.cgi?id=1513

Signed-off-by: Stuart Haslam <stuart.haslam@linaro.org>
---
 test/performance/odp_pktio_perf.c | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

Comments

Maxim Uvarov April 29, 2015, 6:39 a.m. UTC | #1
Merged both patches.

Maxim.

On 04/27/2015 19:48, Stuart Haslam wrote:
> Coverity complains that the return value of odp_pktio_close() isn't
> being checked.
>
> This fixes https://bugs.linaro.org/show_bug.cgi?id=1513
>
> Signed-off-by: Stuart Haslam <stuart.haslam@linaro.org>
> ---
>   test/performance/odp_pktio_perf.c | 15 ++++++++++++---
>   1 file changed, 12 insertions(+), 3 deletions(-)
>
> diff --git a/test/performance/odp_pktio_perf.c b/test/performance/odp_pktio_perf.c
> index 0be8d46..e24ceb5 100644
> --- a/test/performance/odp_pktio_perf.c
> +++ b/test/performance/odp_pktio_perf.c
> @@ -746,10 +746,19 @@ static int test_term(void)
>   	int i;
>   	int ret = 0;
>   
> -	if (gbl_args->pktio_tx != gbl_args->pktio_rx)
> -		odp_pktio_close(gbl_args->pktio_tx);
> +	if (gbl_args->pktio_tx != gbl_args->pktio_rx) {
> +		if (odp_pktio_close(gbl_args->pktio_tx) != 0) {
> +			LOG_ERR("Failed to close pktio_tx\n");
> +			ret = -1;
> +		}
> +	}
> +
>   	destroy_inq(gbl_args->pktio_rx);
> -	odp_pktio_close(gbl_args->pktio_rx);
> +
> +	if (odp_pktio_close(gbl_args->pktio_rx) != 0) {
> +		LOG_ERR("Failed to close pktio_rx\n");
> +		ret = -1;
> +	}
>   
>   	for (i = 0; i < gbl_args->args.num_ifaces; ++i) {
>   		snprintf(pool_name, sizeof(pool_name),
diff mbox

Patch

diff --git a/test/performance/odp_pktio_perf.c b/test/performance/odp_pktio_perf.c
index 0be8d46..e24ceb5 100644
--- a/test/performance/odp_pktio_perf.c
+++ b/test/performance/odp_pktio_perf.c
@@ -746,10 +746,19 @@  static int test_term(void)
 	int i;
 	int ret = 0;
 
-	if (gbl_args->pktio_tx != gbl_args->pktio_rx)
-		odp_pktio_close(gbl_args->pktio_tx);
+	if (gbl_args->pktio_tx != gbl_args->pktio_rx) {
+		if (odp_pktio_close(gbl_args->pktio_tx) != 0) {
+			LOG_ERR("Failed to close pktio_tx\n");
+			ret = -1;
+		}
+	}
+
 	destroy_inq(gbl_args->pktio_rx);
-	odp_pktio_close(gbl_args->pktio_rx);
+
+	if (odp_pktio_close(gbl_args->pktio_rx) != 0) {
+		LOG_ERR("Failed to close pktio_rx\n");
+		ret = -1;
+	}
 
 	for (i = 0; i < gbl_args->args.num_ifaces; ++i) {
 		snprintf(pool_name, sizeof(pool_name),