app/compress-perf: fix reliance on integer endianness
authorArtur Trybula <arturx.trybula@intel.com>
Tue, 4 Jun 2019 12:41:01 +0000 (14:41 +0200)
committerAkhil Goyal <akhil.goyal@nxp.com>
Fri, 5 Jul 2019 13:28:14 +0000 (15:28 +0200)
Reliance on integer endianness (INCOMPATIBLE_CAST) in function
*parse_window_sz*.

Coverity issue: 328524
Fixes: e0b6287c035d ("app/compress-perf: add parser")
Cc: stable@dpdk.org
Signed-off-by: Artur Trybula <arturx.trybula@intel.com>
Acked-by: Shally Verma <shallyv@marvell.com>
app/test-compress-perf/comp_perf_options_parse.c

index 2fb6fb4..a7a8c1f 100644 (file)
@@ -364,12 +364,14 @@ parse_max_num_sgl_segs(struct comp_test_data *test_data, const char *arg)
 static int
 parse_window_sz(struct comp_test_data *test_data, const char *arg)
 {
-       int ret = parse_uint16_t((uint16_t *)&test_data->window_sz, arg);
+       uint16_t tmp;
+       int ret = parse_uint16_t(&tmp, arg);
 
        if (ret) {
                RTE_LOG(ERR, USER1, "Failed to parse window size\n");
                return -1;
        }
+       test_data->window_sz = (int)tmp;
 
        return 0;
 }