summaryrefslogtreecommitdiff
path: root/drivers/s390/crypto/ap_bus.h
diff options
context:
space:
mode:
authorMartin Schwidefsky <schwidefsky@de.ibm.com>2015-06-26 16:55:35 +0200
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2015-10-14 14:32:20 +0200
commit889875a14f0a3205e78613b3e78ecc4efc187d74 (patch)
treedc0d255c0d036647fd86bb73ee3e71797437495c /drivers/s390/crypto/ap_bus.h
parent6acbe21f473f5cff8a11546f090967459b63ab3e (diff)
s390/zcrypt: fix memory leak with ap configuration data
The ap_query_configuration function allocates the ap_config_info structure, but there is no code to free the structure. Allocate the structure in the module_init function and free it again in module_exit. While we are at it simplify a few functions in regard to the ap configuration data. Reviewed-by: Ingo Tuchscherer <ingo.tuchscherer@linux.vnet.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'drivers/s390/crypto/ap_bus.h')
-rw-r--r--drivers/s390/crypto/ap_bus.h3
1 files changed, 0 insertions, 3 deletions
diff --git a/drivers/s390/crypto/ap_bus.h b/drivers/s390/crypto/ap_bus.h
index 2e0a21f84f3d..83cc9e404a77 100644
--- a/drivers/s390/crypto/ap_bus.h
+++ b/drivers/s390/crypto/ap_bus.h
@@ -76,11 +76,8 @@ struct ap_queue_status {
} __packed;
-#define AP_MAX_BITS 31
static inline int ap_test_bit(unsigned int *ptr, unsigned int nr)
{
- if (nr > AP_MAX_BITS)
- return 0;
return (*ptr & (0x80000000u >> nr)) != 0;
}