crypto/aesni_gcm: do crypto op in dequeue function
authorSergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
Wed, 29 Mar 2017 13:42:53 +0000 (14:42 +0100)
committerPablo de Lara <pablo.de.lara.guarch@intel.com>
Wed, 5 Apr 2017 22:17:44 +0000 (00:17 +0200)
commitee7b601f1b87878bb987cfb5610c521a4502492f
tree31dd568c1491506e997343fb2bc3f9e40760f62d
parent37f075dad1e9179448b5685b95a97fb2d7567361
crypto/aesni_gcm: do crypto op in dequeue function

There is bug when more crypto ops are enqueued than dequeued.
The return value is not checked when trying to enqueue the
processed crypto op into the internal ring, which in the case of being
full will results in crypto ops and mbufs being leaked.
The issue is more obvious with different cores doing enqueue/dequeue.

This patch moves the crypto operation to the dequeue function which
fixes the above issue without having to check for the number of free
entries in the ring.

Fixes: eec136f3c54f ("aesni_gcm: add driver for AES-GCM crypto operations")

Signed-off-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
Acked-by: Declan Doherty <declan.doherty@intel.com>
drivers/crypto/aesni_gcm/aesni_gcm_pmd.c