summaryrefslogtreecommitdiff
path: root/net/ceph/crypto.c
diff options
context:
space:
mode:
authorSylvain Munaut <tnt@246tNt.com>2012-08-02 16:12:59 (GMT)
committerSage Weil <sage@inktank.com>2012-08-02 16:19:20 (GMT)
commitf0666b1ac875ff32fe290219b150ec62eebbe10e (patch)
tree9f38d4c5ac83b77812692ccd2db6a880bf63cf9d /net/ceph/crypto.c
parent5ef50c3bec20060bc114f62d6503c5d86d70bdd7 (diff)
downloadlinux-f0666b1ac875ff32fe290219b150ec62eebbe10e.tar.xz
libceph: fix crypto key null deref, memory leak
Avoid crashing if the crypto key payload was NULL, as when it was not correctly allocated and initialized. Also, avoid leaking it. Signed-off-by: Sylvain Munaut <tnt@246tNt.com> Signed-off-by: Sage Weil <sage@inktank.com> Reviewed-by: Alex Elder <elder@inktank.com>
Diffstat (limited to 'net/ceph/crypto.c')
-rw-r--r--net/ceph/crypto.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/net/ceph/crypto.c b/net/ceph/crypto.c
index b780cb7..9da7fdd 100644
--- a/net/ceph/crypto.c
+++ b/net/ceph/crypto.c
@@ -466,6 +466,7 @@ void ceph_key_destroy(struct key *key) {
struct ceph_crypto_key *ckey = key->payload.data;
ceph_crypto_key_destroy(ckey);
+ kfree(ckey);
}
struct key_type key_type_ceph = {