From: Florin Coras Date: Tue, 29 Sep 2020 14:45:25 +0000 (-0700) Subject: hsa: fix coverity warning X-Git-Tag: v21.06-rc0~441 X-Git-Url: https://gerrit.fd.io/r/gitweb?a=commitdiff_plain;h=e7f70d90fe9c34fe61674200a8c4621a81aebd36;p=vpp.git hsa: fix coverity warning Type: fix Signed-off-by: Florin Coras Change-Id: I046e5aa90016e45b5cbaec12593ba4ac7a659783 --- diff --git a/src/plugins/hs_apps/vcl/vcl_test_server.c b/src/plugins/hs_apps/vcl/vcl_test_server.c index d55fef30e89..852c96863ce 100644 --- a/src/plugins/hs_apps/vcl/vcl_test_server.c +++ b/src/plugins/hs_apps/vcl/vcl_test_server.c @@ -255,12 +255,13 @@ vts_server_rx (vcl_test_server_conn_t * conn, int rx_bytes) static void vts_copy_ds (void *buf, vppcom_data_segment_t * ds, u32 max_bytes) { - uint32_t n_bytes = 0, ds_idx = 0; + uint32_t n_bytes = 0, ds_idx = 0, to_copy; while (n_bytes < max_bytes) { - clib_memcpy_fast (buf + n_bytes, ds[ds_idx].data, - clib_min (ds[ds_idx].len, max_bytes - n_bytes)); + to_copy = clib_min (ds[ds_idx].len, max_bytes - n_bytes); + clib_memcpy_fast (buf + n_bytes, ds[ds_idx].data, to_copy); + n_bytes += to_copy; ds_idx += 1; } }