]> git.baikalelectronics.ru Git - kernel.git/commit
s390/zcrypt: fix memleak at release
authorJohan Hovold <johan@kernel.org>
Thu, 10 Oct 2019 13:13:33 +0000 (15:13 +0200)
committerVasily Gorbik <gor@linux.ibm.com>
Tue, 22 Oct 2019 15:55:51 +0000 (17:55 +0200)
commit15822c3f31ec683112c16b9ef0fda6d0be7fb4f5
tree0981cf6223bc6919945797fb5e1da8a4f6de73e9
parentd55ec79322ce9b92dd17cc61a7dbc4dc812814a3
s390/zcrypt: fix memleak at release

If a process is interrupted while accessing the crypto device and the
global ap_perms_mutex is contented, release() could return early and
fail to free related resources.

Fixes: 74a8f13f1789 ("s390/zcrypt: multiple zcrypt device nodes support")
Cc: <stable@vger.kernel.org> # 4.19
Cc: Harald Freudenberger <freude@linux.ibm.com>
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
drivers/s390/crypto/zcrypt_api.c