diff options
Diffstat (limited to 'drivers/s390/crypto/zcrypt_ep11misc.c')
| -rw-r--r-- | drivers/s390/crypto/zcrypt_ep11misc.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/s390/crypto/zcrypt_ep11misc.c b/drivers/s390/crypto/zcrypt_ep11misc.c index 048582851f25..af6582a6ca48 100644 --- a/drivers/s390/crypto/zcrypt_ep11misc.c +++ b/drivers/s390/crypto/zcrypt_ep11misc.c @@ -1598,7 +1598,7 @@ int ep11_findcard2(u32 **apqns, u32 *nr_apqns, u16 cardnr, u16 domain, { struct zcrypt_device_status_ext *device_status; u32 *_apqns = NULL, _nr_apqns = 0; - int i, card, dom, rc = -ENOMEM; + int i, card, dom, rc; struct ep11_domain_info edi; struct ep11_card_info eci; @@ -1608,13 +1608,16 @@ int ep11_findcard2(u32 **apqns, u32 *nr_apqns, u16 cardnr, u16 domain, GFP_KERNEL); if (!device_status) return -ENOMEM; - zcrypt_device_status_mask_ext(device_status); + + zcrypt_device_status_mask_ext(device_status, + MAX_ZDEV_CARDIDS_EXT, + MAX_ZDEV_DOMAINS_EXT); /* allocate 1k space for up to 256 apqns */ _apqns = kmalloc_array(256, sizeof(u32), GFP_KERNEL); if (!_apqns) { - kvfree(device_status); - return -ENOMEM; + rc = -ENOMEM; + goto out; } /* walk through all the crypto apqnss */ @@ -1668,6 +1671,7 @@ int ep11_findcard2(u32 **apqns, u32 *nr_apqns, u16 cardnr, u16 domain, rc = 0; } +out: kvfree(device_status); return rc; } |