[PATCH 04/20] crypto/qat: fix a memory leak when set encrypt key fail

David Marchand david.marchand at redhat.com
Fri Jun 24 22:49:40 CEST 2022


On Tue, Feb 22, 2022 at 7:19 PM Weiguo Li <liwg06 at foxmail.com> wrote:
>
> We allocated memory for 'in', we don't free it when AES_set_encrypt_key()
> fails and it will lead to memory leak.
> We can move set_encrypt_key() ahead of the memory allocation to fix it.

This move seems to fix the leak indeed.
But this change does not follow the pattern used in the rest of this
file and I don't feel confident enough to accept it without the driver
maintainer opinion.


-- 
David Marchand



More information about the dev mailing list