summaryrefslogtreecommitdiffstats
path: root/src/svm/message_queue.c
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2018-07-05 23:44:23 -0700
committerDamjan Marion <dmarion@me.com>2018-07-08 11:21:23 +0000
commit95e0ce05470554e403ade1db322800e489165b1b (patch)
tree47264bc99f04bce9a5f7e747c2b5df08a0ed2644 /src/svm/message_queue.c
parente7cde313e1df14ea118386d678c3e47219090a0d (diff)
session/svm: fix coverity warnings
Change-Id: Ic5daed1f6c23d9561a04e235dcbf257f190d066a Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'src/svm/message_queue.c')
-rw-r--r--src/svm/message_queue.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/svm/message_queue.c b/src/svm/message_queue.c
index dc0f6251120..4f3e7642740 100644
--- a/src/svm/message_queue.c
+++ b/src/svm/message_queue.c
@@ -21,6 +21,7 @@ svm_msg_q_alloc (svm_msg_q_cfg_t * cfg)
{
svm_msg_q_ring_t *ring;
svm_msg_q_t *mq;
+ uword size;
int i;
if (!cfg)
@@ -39,8 +40,10 @@ svm_msg_q_alloc (svm_msg_q_cfg_t * cfg)
if (cfg->ring_cfgs[i].data)
ring->data = cfg->ring_cfgs[i].data;
else
- ring->data = clib_mem_alloc_aligned (ring->nitems * ring->elsize,
- CLIB_CACHE_LINE_BYTES);
+ {
+ size = (uword) ring->nitems * ring->elsize;
+ ring->data = clib_mem_alloc_aligned (size, CLIB_CACHE_LINE_BYTES);
+ }
}
return mq;