mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-08 21:22:09 -04:00
s390/pkey: fix memory leak within _copy_apqns_from_user()
commit f9cac4fd8878929c6ebff0bd272317905d77c38a upstream.
Fixes: f2bbc96e7c ("s390/pkey: add CCA AES cipher key support")
Reported-by: Markus Elfring <Markus.Elfring@web.de>
Reported-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
d0198ab3a2
commit
e8dea4ed48
1 changed files with 3 additions and 1 deletions
|
|
@ -740,8 +740,10 @@ static void *_copy_apqns_from_user(void __user *uapqns, size_t nr_apqns)
|
|||
kapqns = kmalloc(nbytes, GFP_KERNEL);
|
||||
if (!kapqns)
|
||||
return ERR_PTR(-ENOMEM);
|
||||
if (copy_from_user(kapqns, uapqns, nbytes))
|
||||
if (copy_from_user(kapqns, uapqns, nbytes)) {
|
||||
kfree(kapqns);
|
||||
return ERR_PTR(-EFAULT);
|
||||
}
|
||||
}
|
||||
|
||||
return kapqns;
|
||||
|
|
|
|||
Loading…
Reference in a new issue