Home Home > GIT Browse > SLE11-SP4
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Thumshirn <jthumshirn@suse.de>2018-06-11 11:14:00 +0200
committerJohannes Thumshirn <jthumshirn@suse.de>2018-06-11 11:14:05 +0200
commit6c08d86a8d80369c7c6c31d76280a7504367e4bc (patch)
tree66d8b6b5f5bcb55b46f7fe63a3d6916fef3724c5
parent9a76a0994ec66fbea0b7d842fcca0c3cc3fd9459 (diff)
kernel: Fix memory leak on EP11 target list processing
-rw-r--r--drivers/s390/crypto/zcrypt_api.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/s390/crypto/zcrypt_api.c b/drivers/s390/crypto/zcrypt_api.c
index f436cf22edd1..73f934ed85dd 100644
--- a/drivers/s390/crypto/zcrypt_api.c
+++ b/drivers/s390/crypto/zcrypt_api.c
@@ -634,7 +634,10 @@ static long zcrypt_send_ep11_cprb(struct ep11_urb *xcrb)
(struct ep11_target_dev *)xcrb->targets,
xcrb->targets_num *
sizeof(struct ep11_target_dev)))
+ {
+ kfree(ep11_dev_list.targets);
return -EFAULT;
+ }
}
spin_lock_bh(&zcrypt_device_lock);
@@ -666,9 +669,11 @@ static long zcrypt_send_ep11_cprb(struct ep11_urb *xcrb)
put_device(&zdev->ap_dev->device);
zcrypt_device_put(zdev);
spin_unlock_bh(&zcrypt_device_lock);
+ kfree(ep11_dev_list.targets);
return rc;
}
spin_unlock_bh(&zcrypt_device_lock);
+ kfree(ep11_dev_list.targets);
return -ENODEV;
}