]> git.droids-corp.org - dpdk.git/blobdiff - lib/librte_mempool/rte_mempool.c
mempool: fix corruption due to invalid handler
[dpdk.git] / lib / librte_mempool / rte_mempool.c
index 1f1731630856996738e94ca599fe74f9439d3cc2..df8b68c25c9de162aaa69dba7f7b5760986300e5 100644 (file)
@@ -878,7 +878,7 @@ rte_mempool_create(const char *name, unsigned n, unsigned elt_size,
         * Since we have 4 combinations of the SP/SC/MP/MC examine the flags to
         * set the correct index into the table of ops structs.
         */
-       if (flags & (MEMPOOL_F_SP_PUT | MEMPOOL_F_SC_GET))
+       if ((flags & MEMPOOL_F_SP_PUT) && (flags & MEMPOOL_F_SC_GET))
                rte_mempool_set_ops_byname(mp, "ring_sp_sc", NULL);
        else if (flags & MEMPOOL_F_SP_PUT)
                rte_mempool_set_ops_byname(mp, "ring_sp_mc", NULL);