]> git.droids-corp.org - dpdk.git/blobdiff - lib/librte_eal/common/malloc_elem.c
malloc: fix end for bounded elements
[dpdk.git] / lib / librte_eal / common / malloc_elem.c
index 45ec2a1ff34ee83ca33cc35380e864cde3a41219..0cadc8aff12abd1b6c01630b2cfc833fb5bf6c25 100644 (file)
@@ -69,6 +69,7 @@ elem_start_pt(struct malloc_elem *elem, size_t size, unsigned align,
        if ((new_data_start & bmask) != ((end_pt - 1) & bmask)) {
                end_pt = RTE_ALIGN_FLOOR(end_pt, bound);
                new_data_start = RTE_ALIGN_FLOOR((end_pt - size), align);
+               end_pt = new_data_start + size;
                if (((end_pt - 1) & bmask) != (new_data_start & bmask))
                        return NULL;
        }