]> git.droids-corp.org - dpdk.git/commit
ring: fix error code when creating ring
authorYunjian Wang <wangyunjian@huawei.com>
Mon, 10 Jan 2022 09:23:03 +0000 (17:23 +0800)
committerDavid Marchand <david.marchand@redhat.com>
Sat, 5 Feb 2022 16:53:27 +0000 (17:53 +0100)
commit074717be3ef9e7a8868b5af078b0ca7b61bcc44b
treea9aaff032511e90a3343a3ce78b6a932101ba9e8
parent97ed4cb6fb324f4277ee754d4b6f3c7a0d96400b
ring: fix error code when creating ring

The error value returned by rte_ring_create_elem() should be positive
integers. However, if the rte_ring_get_memsize_elem() function fails,
a negative number is returned and is directly used as the return value.
As a result, this will cause the external call to check the return
value to fail(like called by rte_mempool_create()).

Fixes: a182620042aa ("ring: get size in memory")
Cc: stable@dpdk.org
Reported-by: Nan Zhou <zhounan14@huawei.com>
Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
lib/ring/rte_ring.c