security: fix session counter
authorLukasz Wojciechowski <l.wojciechow@partner.samsung.com>
Thu, 9 Apr 2020 17:24:52 +0000 (19:24 +0200)
committerAkhil Goyal <akhil.goyal@nxp.com>
Sun, 19 Apr 2020 15:15:14 +0000 (17:15 +0200)
commite36b5a87d6d0e1e209d85dc22419924cbe02056c
tree689a3b9f428b9f51a3eba635c1c6c67e71a4d927
parent3139b9568bf0889c76da7b7d728f17502d6ff5a9
security: fix session counter

Fix session counter to be decreased in rte_security_session_destroy
only when session was successfully destroyed.

Formerly session counter was decreased prior session destroying
and returning session object to mempool. It remained decreased even
if session was not destroyed and mempool object released making counter
invalid.

Fixes: c261d1431bd8 ("security: introduce security API and framework")
Cc: stable@dpdk.org
Signed-off-by: Lukasz Wojciechowski <l.wojciechow@partner.samsung.com>
Acked-by: Anoob Joseph <anoobj@marvell.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
lib/librte_security/rte_security.c