diff options
author | Haiyang Tan <haiyangtan@tencent.com> | 2018-10-15 06:17:55 -0700 |
---|---|---|
committer | Damjan Marion <dmarion@me.com> | 2018-10-16 11:37:49 +0000 |
commit | a5ab5034f4b50fc5a19ccf8910c91613e6a52f5a (patch) | |
tree | 7ada95f1671e1f5b525355a6f90e6456813a012c /src/vlib/buffer.c | |
parent | e9239c978277d838c0c5ca0ad3076ef85d15138a (diff) |
Fix coverity issue for potentially overflowing of page size
Change-Id: I2779626d745badb63386efcf729da7a094a4f297
Signed-off-by: Haiyang Tan <haiyangtan@tencent.com>
Diffstat (limited to 'src/vlib/buffer.c')
-rw-r--r-- | src/vlib/buffer.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/vlib/buffer.c b/src/vlib/buffer.c index a704efb40f4..785fa9b8aac 100644 --- a/src/vlib/buffer.c +++ b/src/vlib/buffer.c @@ -910,7 +910,7 @@ vlib_buffer_pool_create (vlib_main_t * vm, vlib_physmem_region_index_t pri, p->log2_page_size = pr->log2_page_size; p->buffer_size = buffer_size; - p->buffers_per_page = (1 << pr->log2_page_size) / p->buffer_size; + p->buffers_per_page = (1ull << pr->log2_page_size) / p->buffer_size; p->n_elts = p->buffers_per_page * pr->n_pages; p->n_used = 0; clib_spinlock_init (&p->lock); |