aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
Diffstat (limited to 'net')
-rw-r--r--net/ceph/crypto.c1
-rw-r--r--net/ceph/crypto.h3
2 files changed, 3 insertions, 1 deletions
diff --git a/net/ceph/crypto.c b/net/ceph/crypto.c
index b780cb7947dd..9da7fdd3cd8a 100644
--- a/net/ceph/crypto.c
+++ b/net/ceph/crypto.c
@@ -466,6 +466,7 @@ void ceph_key_destroy(struct key *key) {
466 struct ceph_crypto_key *ckey = key->payload.data; 466 struct ceph_crypto_key *ckey = key->payload.data;
467 467
468 ceph_crypto_key_destroy(ckey); 468 ceph_crypto_key_destroy(ckey);
469 kfree(ckey);
469} 470}
470 471
471struct key_type key_type_ceph = { 472struct key_type key_type_ceph = {
diff --git a/net/ceph/crypto.h b/net/ceph/crypto.h
index 1919d1550d75..3572dc518bc9 100644
--- a/net/ceph/crypto.h
+++ b/net/ceph/crypto.h
@@ -16,7 +16,8 @@ struct ceph_crypto_key {
16 16
17static inline void ceph_crypto_key_destroy(struct ceph_crypto_key *key) 17static inline void ceph_crypto_key_destroy(struct ceph_crypto_key *key)
18{ 18{
19 kfree(key->key); 19 if (key)
20 kfree(key->key);
20} 21}
21 22
22extern int ceph_crypto_key_clone(struct ceph_crypto_key *dst, 23extern int ceph_crypto_key_clone(struct ceph_crypto_key *dst,